diff options
author | James Moger <james.moger@gitblit.com> | 2014-11-01 11:47:52 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-11-01 11:47:52 -0400 |
commit | 8b6657a93b050718fa9642eabf0ee8ff453d0995 (patch) | |
tree | 3ddfdf1e1253ed7e4a913ad4420dea559fe61328 /src/main | |
parent | 0fc37cfe7db1f3c350d544b23a1a9ac650dc2f64 (diff) | |
download | iciql-8b6657a93b050718fa9642eabf0ee8ff453d0995.tar.gz iciql-8b6657a93b050718fa9642eabf0ee8ff453d0995.zip |
Do not attempt to set a null object into a primitive type
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/iciql/TableDefinition.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/iciql/TableDefinition.java b/src/main/java/com/iciql/TableDefinition.java index 7857a5a..db67fc3 100644 --- a/src/main/java/com/iciql/TableDefinition.java +++ b/src/main/java/com/iciql/TableDefinition.java @@ -152,6 +152,12 @@ public class TableDefinition<T> { } else {
o = Utils.convert(o, targetType);
}
+
+ if (targetType.isPrimitive() && o == null) {
+ // do not attempt to set a primitive to null
+ return;
+ }
+
field.set(obj, o);
} catch (IciqlException e) {
throw e;
|