From c3199a3d2b95b501aee757b15d8ce0c819f4bf74 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Wed, 10 Jun 2015 12:18:50 -0400 Subject: [PATCH] fix crash on invalid msg --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 144353e..c2f3dbc 100644 --- a/init.lua +++ b/init.lua @@ -41,7 +41,7 @@ local on_digiline_receive = function(pos, node, channel, msg) local meta = minetest.get_meta(pos) local setchan = meta:get_string("channel") if setchan ~= channel then return end - local num = tonumber(msg) + local num = tonumber(msg) or 0 if msg == "colon" or msg == "period" or msg == "off" or (num >= 0 and num <= 9) then minetest.swap_node(pos, { name = "nixie_tubes:tube_"..msg, param2 = node.param2}) end