From 9d7d79ef94bc7734393ae7f89993e76bbc7d97e3 Mon Sep 17 00:00:00 2001 From: zadam Date: Sat, 30 Jan 2021 22:25:40 +0100 Subject: [PATCH] avoid errors from missing note cache during startup --- src/services/handlers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/handlers.js b/src/services/handlers.js index 6eb42391b..7947d90a1 100644 --- a/src/services/handlers.js +++ b/src/services/handlers.js @@ -25,6 +25,10 @@ eventService.subscribe(eventService.NOTE_TITLE_CHANGED, note => { if (!note.isRoot()) { const noteFromCache = noteCache.notes[note.noteId]; + if (!noteFromCache) { + return; + } + for (const parentNote of noteFromCache.parents) { if (parentNote.hasLabel("sorted")) { treeService.sortNotesAlphabetically(parentNote.noteId);