Skip to content

Commit

Permalink
fix(code editor): prevent reducer from crashing on empty state
Browse files Browse the repository at this point in the history
  • Loading branch information
dmgauthier committed Apr 14, 2021
1 parent 7354ccf commit aac4e14
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const codeEditorsReducer = (
},
};
case CodeEditorActionTypes.remove:
if (Object.keys(state).length > 1) {
if (state && Object.keys(state).length > 1) {
delete state[action.payload.id];
} else {
state = null;
Expand Down

0 comments on commit aac4e14

Please sign in to comment.