From 27e953b127373c371f4fcaea2f200b380760681d Mon Sep 17 00:00:00 2001 From: poire-z Date: Wed, 26 Aug 2020 20:44:54 +0200 Subject: [PATCH] Bookmarks: avoid possible crash (Not sure how and with what this check works and if we still get such kind of items, but avoid a crash when item2.pos0 exists but item1.pos0 does not.) --- frontend/apps/reader/modules/readerbookmark.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readerbookmark.lua b/frontend/apps/reader/modules/readerbookmark.lua index b0ae4fd59..238bf0c10 100644 --- a/frontend/apps/reader/modules/readerbookmark.lua +++ b/frontend/apps/reader/modules/readerbookmark.lua @@ -391,7 +391,8 @@ end function ReaderBookmark:isBookmarkSame(item1, item2) if item1.notes ~= item2.notes then return false end if self.ui.document.info.has_pages then - return item2.pos0 and item2.pos1 and item1.pos0.page == item2.pos0.page + return item1.pos0 and item1.pos1 and item2.pos0 and item2.pos1 + and item1.pos0.page == item2.pos0.page and item1.pos0.x == item2.pos0.x and item1.pos0.y == item2.pos0.y and item1.pos1.x == item2.pos1.x and item1.pos1.y == item2.pos1.y else