From 35feba9692eb868c70cfd4248baa504b3113d700 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Sun, 30 Apr 2017 20:38:23 +0530 Subject: [PATCH] add check on editorWithFocus before using it. --- src/script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/script.js b/src/script.js index 8970b45..f1fb790 100644 --- a/src/script.js +++ b/src/script.js @@ -342,7 +342,9 @@ runBtn, searchInput } else { searchInput.value = ''; // Give last focused editor, focus again - editorWithFocus.focus(); + if (editorWithFocus) { + editorWithFocus.focus(); + } } document.body.classList[isSavedItemsPaneOpen ? 'add' : 'remove']('overlay-visible'); }