Skip to content

Commit 93c340f

Browse files
committed
AbstractUIDetails: do not let getTitle return null
Since it is possible for getIdentifier() to return null, we need to guard against that circumstance, and only return non-null identifiers.
1 parent bce7b69 commit 93c340f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/scijava/AbstractUIDetails.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ public String getTitle() {
105105

106106
// use the unique identifier, if available
107107
if (this instanceof Identifiable) {
108-
return ((Identifiable) this).getIdentifier();
108+
final String id = ((Identifiable) this).getIdentifier();
109+
if (id != null) return id;
109110
}
110111

111112
// use class name as a last resort

0 commit comments

Comments
 (0)