1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

BUGFIX check for parsing errors when localStorage settings are read

This commit is contained in:
Ben De Meester 2015-01-07 11:01:27 +01:00
parent da11659d6c
commit 485c2541f3

View file

@ -269,8 +269,12 @@ EPUBJS.Reader.prototype.applySavedSettings = function() {
if(!localStorage) {
return false;
}
try {
stored = JSON.parse(localStorage.getItem(this.settings.bookKey));
} catch (e) { // parsing error of localStorage
return false;
}
if(stored) {
this.settings = _.defaults(this.settings, stored);