Skip to content

Commit a701a4d

Browse files
committed
refactor(editor): add null check for editor storage access
1 parent 2ae716f commit a701a4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web/core/lib/editor/extensions/slash-command/slash-extension.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export const createSlashExtension = (promptsManager: PromptsManager = PromptsMan
7878
if (!isEditable) return;
7979

8080
component.updateProps(props);
81-
props.editor.storage[extensionName].rect = props.clientRect!();
81+
if (props.editor?.storage[extensionName]) {
82+
props.editor.storage[extensionName].rect = props.clientRect!();
83+
}
84+
8285
popup[0].setProps({
8386
getReferenceClientRect: props.clientRect,
8487
});

0 commit comments

Comments
 (0)