Check for digiline message field type (#670)

This commit is contained in:
1F616EMO~nya 2024-07-02 18:32:19 +08:00 committed by GitHub
parent 0a4651c33c
commit 0c7bb316c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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