From a197f31da7577ce215f46f036d61c7137cf7499f Mon Sep 17 00:00:00 2001 From: chrox Date: Sun, 5 Oct 2014 14:52:37 +0800 Subject: [PATCH] check if last opened file exists before opening it This should fix #916. --- reader.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reader.lua b/reader.lua index f463fcba1..14b464ac7 100755 --- a/reader.lua +++ b/reader.lua @@ -134,6 +134,9 @@ if fontmap ~= nil then end -- last file local last_file = G_reader_settings:readSetting("lastfile") +if last_file and lfs.attributes(last_file, "mode") ~= "file" then + last_file = nil +end -- load last opened file local open_last = G_reader_settings:readSetting("open_last") -- night mode