Skip to content

Commit cd17552

Browse files
committed
Merge pull request sparksuite#102 from arduanov/patch-2
Fix autosave
2 parents 4240da8 + 2335959 commit cd17552

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/simplemde.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ SimpleMDE.prototype.autosave = function() {
871871
}
872872

873873
if(this.options.autosave.loaded !== true) {
874-
if(localStorage.getItem(this.options.autosave.unique_id) != null)
874+
if(typeof localStorage.getItem(this.options.autosave.unique_id) == "string" && localStorage.getItem(this.options.autosave.unique_id) != "")
875875
this.codemirror.setValue(localStorage.getItem(this.options.autosave.unique_id));
876876

877877
this.options.autosave.loaded = true;

0 commit comments

Comments
 (0)