Skip to content

Commit ac4f1fb

Browse files
committed
DefaultUIService: fix bug in default UI logic
The discoverUIs() initialization logic checks the scijava.ui property, and assigns the default UI accordingly. But the getDefaultUI() method was not forcing initialization before checking the value of the defaultUI field, so it was null even when the property was set. This commit forces initialization before getDefaultUI() proceeds, so that the correct default UI is returned.
1 parent fe9ac40 commit ac4f1fb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/scijava/ui/DefaultUIService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public boolean isHeadless() {
190190

191191
@Override
192192
public UserInterface getDefaultUI() {
193+
if (!initialized) discoverUIs();
193194
if (isHeadless()) return uiMap().get(HeadlessUI.NAME);
194195
if (defaultUI != null) return defaultUI;
195196
return uiList().isEmpty() ? null : uiList().get(0);

0 commit comments

Comments
 (0)