Skip to content

Commit

Permalink
[JENKINS-26519] Unreproducible NPE from unmigrateJobsDir.
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Jan 21, 2015
1 parent b2cc363 commit fccc349
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/java/jenkins/model/RunIdMigrator.java
Expand Up @@ -309,7 +309,12 @@ public static void main(String... args) throws Exception {
new RunIdMigrator().unmigrateJobsDir(jobs);
}
private void unmigrateJobsDir(File jobs) throws Exception {
for (File job : jobs.listFiles()) {
File[] jobDirs = jobs.listFiles();
if (jobDirs == null) {
System.err.println(jobs + " claimed to exist, but cannot be listed");
return;
}
for (File job : jobDirs) {
File[] kids = job.listFiles();
if (kids == null) {
continue;
Expand Down

0 comments on commit fccc349

Please sign in to comment.