fix crash when "scroll_speed" is not a number

This commit is contained in:
OgelGames 2020-09-09 19:22:14 +10:00
parent 31a938693a
commit caf6e24d04

@ -360,7 +360,7 @@ local on_digiline_receive_string = function(pos, node, channel, msg)
led_marquee.set_timer(pos, 0) led_marquee.set_timer(pos, 0)
return return
elseif string.sub(msg, 1, 12) == "scroll_speed" then elseif string.sub(msg, 1, 12) == "scroll_speed" then
local timeout = tonumber(string.sub(msg, 13)) local timeout = tonumber(string.sub(msg, 13)) or 0
led_marquee.set_timer(pos, math.max(timeout, led_marquee.message_minimum_time)) led_marquee.set_timer(pos, math.max(timeout, led_marquee.message_minimum_time))
elseif string.sub(msg, 1, 11) == "scroll_step" then elseif string.sub(msg, 1, 11) == "scroll_step" then
local skip = tonumber(string.sub(msg, 12)) local skip = tonumber(string.sub(msg, 12))