From 8b6657a93b050718fa9642eabf0ee8ff453d0995 Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 1 Nov 2014 11:47:52 -0400 Subject: Do not attempt to set a null object into a primitive type --- src/main/java/com/iciql/TableDefinition.java | 6 ++++++ 1 file changed, 6 insertions(+) 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 { } 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; -- cgit v1.2.3