Skip to content

Commit

Permalink
fix crash on error(event) (thanks Huhhila)
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jun 8, 2023
1 parent 42df852 commit 607db13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,9 @@ local function run(pos, event)
local code = meta:get_string("code")
local ok, errmsg = run_inner(pos, meta, event)
if not ok then
if not errmsg then errmsg = "(unknown error)" end
if type(errmsg) ~= "string" then
errmsg = "(unknown error)"
end
terminal_write(pos,"[ERROR] "..errmsg)
reset_meta(pos, code, errmsg)
else
Expand Down

0 comments on commit 607db13

Please sign in to comment.