Skip to content

Commit

Permalink
fix: don't throw NPE in DocumentSnapshot.getDate() when value is miss…
Browse files Browse the repository at this point in the history
…ing (#513)
  • Loading branch information
schmidt-sebastian committed Jan 26, 2021
1 parent d3ff673 commit a41b07e
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -345,7 +345,8 @@ public Long getLong(@Nonnull String field) {
*/
@Nullable
public Date getDate(@Nonnull String field) {
return ((Timestamp) get(field)).toDate();
Timestamp timestamp = getTimestamp(field);
return timestamp == null ? null : timestamp.toDate();
}

/**
Expand Down

0 comments on commit a41b07e

Please sign in to comment.