From a4f81dd812b6d2a0ca190d914d543cf3c0599faa Mon Sep 17 00:00:00 2001 From: Jonathan Rehm Date: Sun, 10 Sep 2017 15:38:24 -0700 Subject: [PATCH] Do not include empty strings in list of bookmarks --- cps/static/js/reading/epub.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cps/static/js/reading/epub.js b/cps/static/js/reading/epub.js index d8de6f5b..5a72d767 100644 --- a/cps/static/js/reading/epub.js +++ b/cps/static/js/reading/epub.js @@ -8,7 +8,7 @@ var reader = ePubReader(calibre.bookUrl, { restore: true, - bookmarks: [calibre.bookmark] + bookmarks: calibre.bookmark ? [calibre.bookmark] : [] }); reader.on("reader:bookmarked", updateBookmark.bind(reader, "add")); reader.on("reader:unbookmarked", updateBookmark.bind(reader, "remove")); @@ -21,7 +21,7 @@ // Remove other bookmarks (there can only be one) if (action === "add") { this.settings.bookmarks.filter(function (bookmark) { - return bookmark !== location; + return bookmark && bookmark !== location; }).map(function (bookmark) { this.removeBookmark(bookmark); }.bind(this));