Skip to content

Commit 6714749

Browse files
committed
remove nan values
1 parent 5978043 commit 6714749

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mesecons_luacontroller/init.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,10 @@ local function clean_and_weigh_digiline_message(msg, back_references)
388388
return msg, #msg + 25
389389
elseif t == "number" then
390390
-- Numbers are passed by value so need not be touched, and cost 8 bytes
391-
-- as all numbers in Lua are doubles.
391+
-- as all numbers in Lua are doubles. NaN values are removed.
392+
if msg ~= msg then
393+
return nil, 0
394+
end
392395
return msg, 8
393396
elseif t == "boolean" then
394397
-- Booleans are passed by value so need not be touched, and cost 1

0 commit comments

Comments
 (0)