fix
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 2 Jul 2020 15:43:02 +0000 (17:43 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 10 Sep 2020 12:15:11 +0000 (14:15 +0200)
src/catalogue/static/player/player.js

index d804463..d93bbad 100644 (file)
                 var initialElem = $('.play', $root).first();
                 var initialTime = 0;
                 if (Modernizr.localstorage) {
-                    audiobooks = JSON.parse(localStorage["audiobook-history"]);
+                    try {
+                        audiobooks = JSON.parse(localStorage["audiobook-history"]);
+                    } catch {
+                        audiobooks = {};
+                    }
                     last = audiobooks[$root.attr("data-book-id")]
                     if (last) {
                         initialElem = $('[data-media-id="' + last[1] + '"] .play', $root).first();