Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
fix: safety about null
Browse files Browse the repository at this point in the history
  • Loading branch information
tkow committed Nov 1, 2018
1 parent 35cb03b commit c17dba2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ValidationWatcher {
this.internal.errorStateId = errorStateId;
}
return (state, action) => {
if (errorStateId in state) {
if (state && errorStateId in state) {
delete state[errorStateId];
}
const nextState = reducer(state, action);
Expand Down

0 comments on commit c17dba2

Please # to comment.