From 90d4d22ba69e819c48d2f27a78ec535fb3a4221f Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sat, 4 Sep 2021 12:02:06 +0200 Subject: [PATCH] ReaderBookmark:renameBookmark: Better nil guard (#8176) When matching a highlight to a bookmark *really* fails. (Noticed in the log from #8175) --- frontend/apps/reader/modules/readerbookmark.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readerbookmark.lua b/frontend/apps/reader/modules/readerbookmark.lua index d0042600c..8b5e88a28 100644 --- a/frontend/apps/reader/modules/readerbookmark.lua +++ b/frontend/apps/reader/modules/readerbookmark.lua @@ -621,7 +621,7 @@ function ReaderBookmark:renameBookmark(item, from_highlight) break end end - if bookmark.text == nil then -- bookmark not found + if not bookmark or bookmark.text == nil then -- bookmark not found return end else