Skip to content

Commit

Permalink
Fix NPE when SplashScreen::update is consumer
Browse files Browse the repository at this point in the history
The update method in question accepts a small-D double,
not a big-D Double, so passing null to it is a no-no.
  • Loading branch information
ctrueden committed Nov 19, 2024
1 parent 189fdc4 commit 2ac04d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/scijava/launcher/Java.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public static void upgrade(BiConsumer<String, Double> subscriber)
throw new IOException("Invalid Java root directory");
}

subscriber.accept("Updating Java...", null);
subscriber.accept("Updating Java...", Double.NaN);

// Download the mapping of platforms to Java download links.
String javaLinks = sysProp("scijava.app.java-links");
Expand Down Expand Up @@ -316,7 +316,7 @@ public static void upgrade(BiConsumer<String, Double> subscriber)
// This is only a heuristic, but it works for most Java archives.
if (s != null && dir[0] == null && s.endsWith("/")) dir[0] = s;
// Forward the message on to our upgrade subscriber.
subscriber.accept("Unpacking " + s, null);
subscriber.accept("Unpacking " + s, Double.NaN);
}));

// Write new installation location into the requested configuration file.
Expand All @@ -329,7 +329,7 @@ public static void upgrade(BiConsumer<String, Double> subscriber)
}
}

subscriber.accept("Java update complete", null);
subscriber.accept("Java update complete", Double.NaN);
}

private static String sysProp(String key) {
Expand Down

0 comments on commit 2ac04d4

Please sign in to comment.