From afa0101e68fb292420dfdc2cedc9be676023b166 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Tue, 1 Sep 2015 20:31:32 -0500 Subject: [PATCH] Better element option behavior according to #79 --- src/js/simplemde.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/js/simplemde.js b/src/js/simplemde.js index 5baa6ca..f2b65cb 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -721,6 +721,11 @@ function SimpleMDE(options) { if(options.element) { this.element = options.element; } + else if(options.element === null) { + // This means that the element option was specified, but no element was found + console.log("SimpleMDE: Error. No element was found."); + return; + } if(options.toolbar !== false) options.toolbar = options.toolbar || SimpleMDE.toolbar;