yet another set of bugfixes

The key API change I'd underestimated: opening a file used to return nil
on failure, and now returns false.
This commit is contained in:
Kartik K. Agaram 2023-08-30 23:52:25 -07:00
parent 06ad5c4e8c
commit 6e54ad55d9
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ end
function save_to_disk(State)
local outfile = App.open_for_writing(State.filename)
if outfile == nil then
if not outfile then
error('failed to write to "'..State.filename..'"')
end
for _,line in ipairs(State.lines) do

View File

@ -45,7 +45,7 @@ end
function save_to_disk(State)
local outfile = App.open_for_writing(App.save_dir..State.filename)
if outfile == nil then
if not outfile then
error('failed to write to "'..State.filename..'"')
end
for _,line in ipairs(State.lines) do