exit if gcode file info could not be retrieved

This commit is contained in:
Simon Voordouw 2017-06-22 14:31:32 +02:00
parent 9571af19ac
commit ae46535275
1 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,11 @@ log("gcode server: " .. gcodeServer)
local info = JSON:decode(io.popen("wget -qO - " .. gcodeServer .. "/info/" .. id):read("*a"))
if info == nil then
log("could not retrieve file info")
return
end
local current_line = 0
local total_lines = tonumber(info["lines"])
local started = false