fix(screensaver): lastfile will be nil for fresh installation

pull/1080/head
Qingping Hou 10 years ago
parent a300f1e981
commit 6eca26f610

@ -98,12 +98,13 @@ function Screensaver:show()
-- first check book cover image
if KOBO_SCREEN_SAVER_LAST_BOOK then
local lastfile = G_reader_settings:readSetting("lastfile")
local data = DocSettings:open(lastfile)
local exclude = data:readSetting("exclude_screensaver")
if not exclude then
self.suspend_msg = self:getCoverImage(lastfile)
if lastfile then
local data = DocSettings:open(lastfile)
local exclude = data:readSetting("exclude_screensaver")
if not exclude then
self.suspend_msg = self:getCoverImage(lastfile)
end
end
end
-- then screensaver directory or file image
if not self.suspend_msg then

Loading…
Cancel
Save