From 2c556445770b697ea3d095cb22c3de4946e30f01 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Tue, 21 Dec 2021 16:32:54 -0700 Subject: [PATCH] Selector improvement --- src/store/state/selectors.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/store/state/selectors.ts b/src/store/state/selectors.ts index 0e68d636..49c37e87 100644 --- a/src/store/state/selectors.ts +++ b/src/store/state/selectors.ts @@ -26,5 +26,6 @@ export function getEditorStateViews(state: State, stateKey: any | null): EditorV const stateId = opts.transformKeyToId(stateKey); if (!stateId) return []; const editor = state.editor.state.editors[stateId]; + if (!editor) return []; return editor.viewIds.map((id) => state.editor.state.views[id].view).filter((v) => v != null); }