diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx index f01c0aa76..57f6ff723 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/Editor.tsx @@ -220,7 +220,7 @@ function Editor(props: EditorProps, ref: any) { cm.off('refresh', editor_resize); cm.off('update', editor_update); // eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied - editorParent.current.removeChild(cm.getWrapperElement()); + if (editorParent.current) editorParent.current.removeChild(cm.getWrapperElement()); setEditor(null); }; // eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied diff --git a/packages/app-desktop/services/plugins/hooks/useViewIsReady.ts b/packages/app-desktop/services/plugins/hooks/useViewIsReady.ts index 0278f4cf9..7abe989dd 100644 --- a/packages/app-desktop/services/plugins/hooks/useViewIsReady.ts +++ b/packages/app-desktop/services/plugins/hooks/useViewIsReady.ts @@ -41,10 +41,12 @@ export default function useViewIsReady(viewRef: any) { viewRef.current.contentWindow.addEventListener('message', onMessage); return () => { - viewRef.current.removeEventListener('dom-ready', onIFrameReady); - viewRef.current.removeEventListener('load', onIFrameReady); - // eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied - viewRef.current.contentWindow.removeEventListener('message', onMessage); + if (viewRef.current) { + viewRef.current.removeEventListener('dom-ready', onIFrameReady); + viewRef.current.removeEventListener('load', onIFrameReady); + // eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied + viewRef.current.contentWindow.removeEventListener('message', onMessage); + } }; // eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied }, []); diff --git a/packages/tools/website/updateNews.ts b/packages/tools/website/updateNews.ts index 66b0b4a95..dd8c87767 100644 --- a/packages/tools/website/updateNews.ts +++ b/packages/tools/website/updateNews.ts @@ -114,7 +114,7 @@ const execApi = async (method: HttpMethod, path: string, body: Record => {