Skip to content

Commit a73a89c

Browse files
committed
Fix problem reported in #1299 for 2.7
1 parent 24166ac commit a73a89c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

release-notes/VERSION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Project: jackson-databind
1010
(reported by brentryan@github)
1111
#1279: Ensure DOM parsing defaults to not expanding external entities
1212
#1288: Type id not exposed for `JsonTypeInfo.As.EXTERNAL_PROPERTY` even when `visible` set to `true`
13+
#1299: Timestamp deserialization error
14+
(reported by liyuj@github)
1315
#1301: Problem with `JavaType.toString()` for recursive (self-referential) types
1416
(reported by Brian P)
1517
#1307: `TypeWrappedDeserializer` doesn't delegate the `getNullValue()` method to `_deserializer`

src/main/java/com/fasterxml/jackson/databind/deser/std/DateDeserializers.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ protected TimestampDeserializer withDateFormat(DateFormat df, String formatStrin
308308
@Override
309309
public java.sql.Timestamp deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException
310310
{
311-
return new Timestamp(_parseDate(jp, ctxt).getTime());
311+
Date d = _parseDate(jp, ctxt);
312+
return (d == null) ? null : new Timestamp(d.getTime());
312313
}
313314
}
314315
}

0 commit comments

Comments
 (0)