Skip to content

Commit 8cc1736

Browse files
committed
ModuleSearchResult: be more defensive when checking menu leaf
When info.getMenuPath().getLeaf() was null (as is the case for net.imagej.updater.PromptUserToUpdate), the context() method was throwing a NullPointerException. Let's be more defensive and avoid calling the toString() method on MenuEntry.
1 parent 6105bdd commit 8cc1736

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/search/module/ModuleSearchResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public String identifier() {
8383

8484
@Override
8585
public String context() {
86-
return "/" + getMenuPath(name() != info.getMenuPath().getLeaf().toString(), "/");
86+
return "/" + getMenuPath(name() != "" + info.getMenuPath().getLeaf(), "/");
8787
}
8888

8989
@Override

0 commit comments

Comments
 (0)