diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-08 22:50:39 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-08 22:50:39 +1300 |
commit | c99e32bb5da8a19c19c13e871d5c7b843b2bd182 (patch) | |
tree | e36ad02ab99876e1cdcc2db0a58b74fbb6ef27de /src/org/traccar/database | |
parent | 1264391afbf2407b5ea406f3b540ca34cb667543 (diff) | |
download | trackermap-server-c99e32bb5da8a19c19c13e871d5c7b843b2bd182.tar.gz trackermap-server-c99e32bb5da8a19c19c13e871d5c7b843b2bd182.tar.bz2 trackermap-server-c99e32bb5da8a19c19c13e871d5c7b843b2bd182.zip |
Check for null in query builder
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r-- | src/org/traccar/database/QueryBuilder.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java index 11dbcd1b9..5846d4285 100644 --- a/src/org/traccar/database/QueryBuilder.java +++ b/src/org/traccar/database/QueryBuilder.java @@ -374,7 +374,10 @@ public class QueryBuilder { @Override public void process(T object, ResultSet resultSet) throws SQLException { try { - method.invoke(object, new Date(resultSet.getTimestamp(name).getTime())); + Timestamp timestamp = resultSet.getTimestamp(name); + if (timestamp != null) { + method.invoke(object, new Date(timestamp.getTime())); + } } catch (IllegalAccessException | InvocationTargetException error) { Log.warning(error); } |