From 4bc646072c4d77978a42152c3b4c5124049319d7 Mon Sep 17 00:00:00 2001 From: Mindaugas Vasiliauskas Date: Fri, 14 Feb 2020 16:44:04 +0200 Subject: [PATCH] Added additional check so that no errors would be thrown when no notes are present --- modules/ui/notes-editor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ui/notes-editor.js b/modules/ui/notes-editor.js index 7e1d2bd1..07376acc 100644 --- a/modules/ui/notes-editor.js +++ b/modules/ui/notes-editor.js @@ -53,12 +53,14 @@ function editNotes(id, name) { function changeName() { const id = document.getElementById("notesSelect").value; const note = notes.find(note => note.id === id); + if (!note) return; note.name = this.value; } function changeText() { const id = document.getElementById("notesSelect").value; const note = notes.find(note => note.id === id); + if (!note) return; note.legend = this.value; }