Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
0004225: fix npe converting to date
  • Loading branch information
erilong committed May 21, 2020
1 parent 6ea3a61 commit 5c80717
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -75,9 +75,11 @@ public <T> T getObjectFromResultSet(ResultSet rs, Class<T> clazz) throws SQLExce
String s = rs.getString(1);
Date d = null;

d = FormatUtils.parseDate(s,FormatUtils.TIMESTAMP_PATTERNS);
if (s != null) {
d = FormatUtils.parseDate(s, FormatUtils.TIMESTAMP_PATTERNS);
}

if (Timestamp.class.isAssignableFrom(clazz)) {
if (d != null && Timestamp.class.isAssignableFrom(clazz)) {
return (T) new Timestamp(d.getTime());
} else {
return (T) d;
Expand Down

0 comments on commit 5c80717

Please sign in to comment.