Skip to content

Commit

Permalink
Check for digiline message field type
Browse files Browse the repository at this point in the history
  • Loading branch information
Emojigit committed Apr 19, 2024
1 parent cffbc33 commit 9622278
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mesecons_detector/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ local node_detector_digiline = {

if type(msg) == "table" then
if msg.distance or msg.scanname then
if msg.distance then
if msg.distance and type(msg.distance) == "string" then
meta:set_string("distance", msg.distance)
end
if msg.scanname then
if msg.scanname and type(msg.scanname) == "string" then
meta:set_string("scanname", msg.scanname)
end
node_detector_make_formspec(pos)
Expand All @@ -240,7 +240,7 @@ local node_detector_digiline = {
else
if msg == GET_COMMAND then
node_detector_send_node_name(pos, node, channel, meta)
else
elseif type(msg) == "string" then
meta:set_string("scanname", msg)
node_detector_make_formspec(pos)
end
Expand Down

0 comments on commit 9622278

Please sign in to comment.