Skip to content

Commit cf050a9

Browse files
committed
Fix stringifying false and nil
1 parent 535945b commit cf050a9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lua/utilities.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,14 +590,22 @@ function SerializableDeepCopy(t)
590590
local st = serializableTypes
591591
local type_t = type(t)
592592
if type_t ~= 'table' then
593-
return st[type_t] and t or tostring(t)
593+
if st[type_t] then
594+
return t
595+
else
596+
return tostring(t)
597+
end
594598
end
595599

596600
local backrefs = {}
597601
local function CreateSerializableAny(_t)
598602
local type_t = type(_t)
599603
if type_t ~= 'table' then
600-
return st[type_t] and _t or tostring(_t)
604+
if st[type_t] then
605+
return _t
606+
else
607+
return tostring(_t)
608+
end
601609
end
602610

603611
local b = backrefs[_t]

0 commit comments

Comments
 (0)