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:
parent
da11659d6c
commit
485c2541f3
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue