]> source.dussan.org Git - iciql.git/commitdiff
Do not attempt to set a null object into a primitive type
authorJames Moger <james.moger@gitblit.com>
Sat, 1 Nov 2014 15:47:52 +0000 (11:47 -0400)
committerJames Moger <james.moger@gitblit.com>
Sat, 1 Nov 2014 15:47:52 +0000 (11:47 -0400)
src/main/java/com/iciql/TableDefinition.java

index 7857a5ac4652baeb7d8410f6f884b634ea90daf8..db67fc3126bdfa412e24b489232373f37746d9c2 100644 (file)
@@ -152,6 +152,12 @@ public class TableDefinition<T> {
                                } else {\r
                                        o = Utils.convert(o, targetType);\r
                                }\r
+\r
+                               if (targetType.isPrimitive() && o == null) {\r
+                                       // do not attempt to set a primitive to null\r
+                                       return;\r
+                               }\r
+\r
                                field.set(obj, o);\r
                        } catch (IciqlException e) {\r
                                throw e;\r