mirror of
https://github.com/Keyslam-Group/Concord.git
synced 2025-09-02 12:24:11 -04:00
Fix component:serialize can return nil
This commit is contained in:
parent
78dc7ee937
commit
f640258852
1 changed files with 4 additions and 2 deletions
|
@ -190,11 +190,13 @@ function Entity:serialize()
|
|||
for _, component in pairs(self.__components) do
|
||||
if component.__name then
|
||||
local componentData = component:serialize()
|
||||
componentData.__name = component.__name
|
||||
|
||||
if componentData ~= nil then
|
||||
componentData.__name = component.__name
|
||||
data[#data + 1] = componentData
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return data
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue