scenario: open a file starting with a drawing After this commit the program doesn't crash.
Error: [string "edit.lua"]:127: attempt to get length of field 'data' (a nil value) stack traceback: [love "boot.lua"]:345: in function '__len' [string "edit.lua"]:127: in function 'invalid1' [string "edit.lua"]:116: in function 'check_locs' [string "run.lua"]:35: in function 'initialize' main.lua:96: in function 'initialize' [string "app.lua"]:144: in function 'run_tests_and_initialize' [string "app.lua"]:16: in function <[string "app.lua"]:13> [C]: in function 'xpcall' [love "boot.lua"]:361: in function <[love "boot.lua"]:348> [C]: in function 'xpcall'
AF253GHLDMRDMDL5X3OV2UJ5NPKBBMHGH4B3R5IGR35KO6IKYPKQC
return loc1.line > #State.lines
or loc1.pos > #State.lines[loc1.line].data
if loc1.line > #State.lines then return true end
local l = State.lines[loc1.line]
if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing line
return loc1.pos > #State.lines[loc1.line].data