Skip to content

Commit

Permalink
Fix a NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
serverperformance committed Aug 20, 2014
1 parent ac4ebef commit 004cc5c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,16 @@ public Class read (Kryo kryo, Input input, Class<Class> type) {
* @author Tumi <[email protected]> */
static public class DateSerializer extends Serializer<Date> {
private Date create(Kryo kryo, Class<? extends Date> type, long time) throws KryoException {
if (type==Date.class) {
if (type == null || type == Date.class) {
return new Date(time);
}
if (type==Timestamp.class) {
if (type == Timestamp.class) {
return new Timestamp(time);
}
if (type==java.sql.Date.class) {
if (type == java.sql.Date.class) {
return new java.sql.Date(time);
}
if (type==Time.class) {
if (type == Time.class) {
return new Time(time);
}
// other cases, reflection
Expand Down

0 comments on commit 004cc5c

Please sign in to comment.