diff --git a/DaoCore/src/main/java/org/greenrobot/greendao/query/WhereCondition.java b/DaoCore/src/main/java/org/greenrobot/greendao/query/WhereCondition.java index 058fa1835..5d29c6f38 100644 --- a/DaoCore/src/main/java/org/greenrobot/greendao/query/WhereCondition.java +++ b/DaoCore/src/main/java/org/greenrobot/greendao/query/WhereCondition.java @@ -71,10 +71,13 @@ public void appendValuesTo(List valuesTarget) { class PropertyCondition extends AbstractCondition { private static Object checkValueForType(Property property, Object value) { - if (value != null && value.getClass().isArray()) { + Class type = property.type; + if (value == null) { + throw new DaoException("Illegal " + type.getSimpleName() + " value: expected " + type.getName() + " value, but was null"); + } + if (value.getClass().isArray()) { throw new DaoException("Illegal value: found array, but simple object required"); } - Class type = property.type; if (type == Date.class) { if (value instanceof Date) { return ((Date) value).getTime();