Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw exception when null value in WhereCondition #438

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ public void appendValuesTo(List<Object> 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();
Expand Down