modules/luci-mod-failsafe: Fix nil file descriptor error

Signed-off-by: Ekaitz Zárraga <ekaitz.zarraga@fon.com>
This commit is contained in:
Ekaitz Zárraga 2015-09-14 13:31:49 +02:00
parent 6e1a089b5c
commit a16654b121

View file

@ -84,6 +84,7 @@ function action_flashops()
fp = io.open(image_tmp, "w") fp = io.open(image_tmp, "w")
end end
end end
if fp then
if chunk then if chunk then
fp:write(chunk) fp:write(chunk)
end end
@ -91,6 +92,7 @@ function action_flashops()
fp:close() fp:close()
end end
end end
end
) )
if luci.http.formvalue("image") or luci.http.formvalue("step") then if luci.http.formvalue("image") or luci.http.formvalue("step") then