Skip to content

Commit 4f70b9a

Browse files
committedOct 19, 2024
ImageJUpdater: let any/all services be null
The code was already written to support the services not being set, with various fallbacks in place. So let's mark the params accordingly.
1 parent 974f8d0 commit 4f70b9a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎src/main/java/net/imagej/ui/swing/updater/ImageJUpdater.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,16 @@
7171
public class ImageJUpdater implements UpdaterUI {
7272
private UpdaterFrame main;
7373

74-
@Parameter
74+
@Parameter(required = false)
7575
private StatusService statusService;
7676

77-
@Parameter
77+
@Parameter(required = false)
7878
private LogService log;
7979

80-
@Parameter
80+
@Parameter(required = false)
8181
private UploaderService uploaderService;
8282

83-
@Parameter
83+
@Parameter(required = false)
8484
private CommandService commandService;
8585

8686
private final static String UPDATER_UPDATING_THREAD_NAME = "Updating the Updater itself!";

‎src/main/java/net/imagej/ui/swing/updater/UpdaterFrame.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public void run() {
357357
upload();
358358
}
359359
catch (final InstantiationException e) {
360-
log.error(e);
360+
if (log != null) log.error(e);
361361
error("Could not upload (possibly unknown protocol)");
362362
}
363363
}
@@ -395,7 +395,7 @@ public void setVisible(final boolean visible) {
395395
} catch (final InterruptedException e) {
396396
// ignore
397397
} catch (final InvocationTargetException e) {
398-
log.error(e);
398+
if (log != null) log.error(e);
399399
}
400400
return;
401401
}
@@ -606,7 +606,7 @@ public void install() {
606606
installer.done();
607607
}
608608
catch (final Exception e) {
609-
log.error(e);
609+
if (log != null) log.error(e);
610610
// TODO: remove "update/" directory
611611
error("Installer failed: " + e);
612612
installer.done();

0 commit comments

Comments
 (0)
Please sign in to comment.