Skip to content

Commit 584b538

Browse files
committed
DefaultPrefService: guard against null LogService
1 parent ab2a9ad commit 584b538

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/java/org/scijava/prefs/DefaultPrefService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ private String[] allPrefs() {
386386
return java.util.prefs.Preferences.userRoot().childrenNames();
387387
}
388388
catch (java.util.prefs.BackingStoreException exc) {
389-
log.error(exc);
389+
if (log != null) log.error(exc);
390390
return new String[0];
391391
}
392392
}
@@ -526,7 +526,7 @@ public void clear() {
526526
p.clear();
527527
}
528528
catch (java.util.prefs.BackingStoreException exc) {
529-
log.error(exc);
529+
if (log != null) log.error(exc);
530530
}
531531
}
532532

@@ -590,7 +590,7 @@ public String[] keys() {
590590
return keys;
591591
}
592592
catch (final java.util.prefs.BackingStoreException exc) {
593-
log.error(exc);
593+
if (log != null) log.error(exc);
594594
return new String[0];
595595
}
596596
}
@@ -606,7 +606,7 @@ public boolean nodeExists(final String pathName) {
606606
return p.nodeExists(safeName(pathName));
607607
}
608608
catch (final java.util.prefs.BackingStoreException exc) {
609-
log.error(exc);
609+
if (log != null) log.error(exc);
610610
return false;
611611
}
612612
}
@@ -617,7 +617,7 @@ public void removeNode() {
617617
p.removeNode();
618618
}
619619
catch (final java.util.prefs.BackingStoreException exc) {
620-
log.error(exc);
620+
if (log != null) log.error(exc);
621621
}
622622
}
623623

0 commit comments

Comments
 (0)