reordered freeing of resources, error handling for doc open

This commit is contained in:
HW
2011-12-09 00:10:54 +01:00
parent 78f6fa4530
commit 1af5ce3d04
2 changed files with 14 additions and 13 deletions

View File

@@ -78,9 +78,10 @@ if lfs.attributes(ARGV[optind], "mode") == "directory" then
while running do
local pdffile = FileChooser:choose(0,height)
if pdffile ~= nil then
PDFReader:open(pdffile,"") -- TODO: query for password
PDFReader:goto(tonumber(PDFReader.settings:readsetting("last_page") or 1))
PDFReader:inputloop()
if PDFReader:open(pdffile,"") then -- TODO: query for password
PDFReader:goto(tonumber(PDFReader.settings:readsetting("last_page") or 1))
PDFReader:inputloop()
end
else
running = false
end