Skip to content

Commit

Permalink
redux-persist: Stop erroring on a case we've seen empirically
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed Feb 19, 2022
1 parent 5a14868 commit d38945c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/third/redux-persist/getStoredState.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ export default async function getStoredState(config: Config): Promise<{ ... }> {
});
return;
}
invariant(serialized !== null, 'key was found above, should be present here');
if (serialized === null) {
// This shouldn't be possible, but empirically it does happen, so
// we don't use `invariant` here. It may have to do with the janky
// way AsyncStorage stores large values out-of-line in separate
// files on iOS? ¯\_(ツ)_/¯
logging.warn('key was found above, should be present here', { key });
return;
}

try {
restoredState[key] = deserializer(serialized);
Expand Down

0 comments on commit d38945c

Please sign in to comment.