Don't crash on pressing Del in History

After deleting all the entries from History we should guard against
pressing Del to try to delete a non-existent entry.
Tigran Aivazian 12 years ago
parent 819efb55aa
commit 0987c2826e

@ -220,6 +220,7 @@ function FileHistory:addAllCommands()
"delete history entry",
function(self)
file_entry = self.result[self.perpage*(self.page-1)+self.current]
if not file_entry then return end
local file_to_del = file_entry.dir .. "/" .. file_entry.name
os.remove(DocToHistory(file_to_del))
-- to avoid showing just deleted file

Loading…
Cancel
Save