mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
issue error directly when doc is malformated
This should popup a message saying "No reader engine for this file" instead of a crash when document file is malformated. This should fix #868.
This commit is contained in:
@@ -11,8 +11,7 @@ function PicDocument:init()
|
||||
if not pic then pic = require("ffi/pic") end
|
||||
ok, self._document = pcall(pic.openDocument, self.file)
|
||||
if not ok then
|
||||
self.error_message = "failed to open jpeg image"
|
||||
return
|
||||
error("Failed to open jpeg image")
|
||||
end
|
||||
|
||||
self.info.has_pages = true
|
||||
|
||||
Reference in New Issue
Block a user