Skip to content

Commit 0c7bb31

Browse files
authored
Check for digiline message field type (#670)
1 parent 0a4651c commit 0c7bb31

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mesecons_detector/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ local node_detector_digiline = {
223223

224224
if type(msg) == "table" then
225225
if msg.distance or msg.scanname then
226-
if msg.distance then
226+
if type(msg.distance) == "string" then
227227
meta:set_string("distance", msg.distance)
228228
end
229-
if msg.scanname then
229+
if type(msg.scanname) == "string" then
230230
meta:set_string("scanname", msg.scanname)
231231
end
232232
node_detector_make_formspec(pos)
@@ -240,7 +240,7 @@ local node_detector_digiline = {
240240
else
241241
if msg == GET_COMMAND then
242242
node_detector_send_node_name(pos, node, channel, meta)
243-
else
243+
elseif type(msg) == "string" then
244244
meta:set_string("scanname", msg)
245245
node_detector_make_formspec(pos)
246246
end

0 commit comments

Comments
 (0)