From ddd03eab1d2d5534c4c65c45eb365c30af551f50 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Wed, 19 Dec 2018 07:09:16 -0600 Subject: [PATCH] Prevent JS error in multiple section search --- edit/sections-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edit/sections-editor.js b/edit/sections-editor.js index 949f7f29..7e2f8063 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -138,7 +138,7 @@ function createSectionsEditor({style, onTitleChanged}) { if (index >= 0 && distances[index] !== undefined) { return distances[index]; } - const section = cm.display.wrapper.closest('.section'); + const section = cm && cm.display.wrapper.closest('.section'); if (!section) { return 1e9; }