Skip to content

Commit 9934d04

Browse files
committed
DefaultConverter: fix null primitive values bug
If the destination type is a primitive, we cannot return null. We must return the designated null-like value for that type instead.
1 parent 8932051 commit 9934d04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scijava/convert/DefaultConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public <T> T convert(final Object src, final Class<T> dest) {
185185
catch (final Exception exc) {
186186
// TODO: Best not to catch blanket Exceptions here.
187187
// no known way to convert
188-
return null;
188+
return Types.nullValue(dest);
189189
}
190190
}
191191

0 commit comments

Comments
 (0)