Fix null handling

This commit is contained in:
Kimmo Puputti 2017-10-04 14:50:41 +03:00
parent 251e0b2beb
commit b74ffebb3e

View file

@ -74,7 +74,7 @@ export const storedData = storageKey => {
// Dates are expected to be in format: { date: new Date(), _serializedType: 'SerializableDate' }
const reviver = (k, v) => {
// eslint-disable-next-line no-underscore-dangle
if (typeof v === 'object' && v._serializedType === 'SerializableDate') {
if (v && typeof v === 'object' && v._serializedType === 'SerializableDate') {
return new Date(v.date);
}
return types.reviver(k, v);