From 7aedb8623a3ec59e83ce619beedb53e16350f54c Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Wed, 13 Jan 2016 00:46:35 -0600 Subject: [PATCH] Fix options undefined bug when clearing autosave value Occurred when the autosave option was not present and a user tried to clear the autosaved value. --- src/js/simplemde.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/simplemde.js b/src/js/simplemde.js index 61392f8..0e14336 100644 --- a/src/js/simplemde.js +++ b/src/js/simplemde.js @@ -1233,8 +1233,8 @@ SimpleMDE.prototype.autosave = function() { SimpleMDE.prototype.clearAutosavedValue = function() { if(localStorage) { - if(this.options.autosave.uniqueId == undefined || this.options.autosave.uniqueId == "") { - console.log("SimpleMDE: You must set a uniqueId to use the autosave feature"); + if(this.options.autosave == undefined || this.options.autosave.uniqueId == undefined || this.options.autosave.uniqueId == "") { + console.log("SimpleMDE: You must set a uniqueId to clear the autosave value"); return; }