diff --git a/plugins/evernote.koplugin/clip.lua b/plugins/evernote.koplugin/clip.lua index f5a72153b..c6c5d3a10 100644 --- a/plugins/evernote.koplugin/clip.lua +++ b/plugins/evernote.koplugin/clip.lua @@ -1,6 +1,7 @@ local DocumentRegistry = require("document/documentregistry") local DocSettings = require("docsettings") local ReadHistory = require("readhistory") +local logger = require("logger") local md5 = require("ffi/MD5") local util = require("util") @@ -263,7 +264,16 @@ function MyClipping:parseHistoryFile(clippings, history_file, doc_file) end if lfs.attributes(doc_file, "mode") ~= "file" then return end local ok, stored = pcall(dofile, history_file) - if ok and stored.highlight then + if ok then + if not stored then + logger.warn("An empty history file ", + history_file, + "has been found. The book associated is ", + doc_file) + return + elseif not stored.highlight then + return + end local _, docname = util.splitFilePathName(doc_file) local title, author = self:getTitle(util.splitFileNameSuffix(docname)) clippings[title] = {