Merge pull request #473 from ekaitz-zarraga/fix-luci-failsafe

modules/luci-mod-failsafe: Fix nil file descriptor error
This commit is contained in:
Hannu Nyman 2015-09-17 11:43:05 +03:00
commit 892dd7383a

View file

@ -84,11 +84,13 @@ function action_flashops()
fp = io.open(image_tmp, "w") fp = io.open(image_tmp, "w")
end end
end end
if chunk then if fp then
fp:write(chunk) if chunk then
end fp:write(chunk)
if eof then end
fp:close() if eof then
fp:close()
end
end end
end end
) )