Skip to content

Commit 49f4950

Browse files
committed
DefaultWidgetModel: guard against null conversions
When the conversion fails, it returns null. In that case, we should treat the converted value as identical to the original value.
1 parent fa5133b commit 49f4950

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/scijava/widget/DefaultWidgetModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ public void setValue(final Object value) {
156156

157157
// Pass the value through the convertService
158158
convertedInput = convertService.convert(value, item.getType());
159+
if (convertedInput == null) convertedInput = value;
159160

160161
// If we get a different (converted) value back, cache it weakly.
161162
if (convertedInput != value) {

0 commit comments

Comments
 (0)