Skip to content

Commit 2aa27cc

Browse files
authored
Stop some wire lib functions from causing errors (#2228)
* Update wire.lua * Update wire.lua
1 parent 2261282 commit 2aa27cc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lua/starfall/libs_sv/wire.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,13 @@ local function parseEntity(ent, io)
570570
end
571571

572572
local names, types = {}, {}
573-
for k, v in pairs(ent[io]) do
574-
if isstring(k) and isstring(v.Type) and k ~= "" then
575-
table.insert(names, k)
576-
table.insert(types, v.Type)
573+
574+
if ent[io] then
575+
for k, v in pairs(ent[io]) do
576+
if isstring(k) and isstring(v.Type) and k ~= "" then
577+
table.insert(names, k)
578+
table.insert(types, v.Type)
579+
end
577580
end
578581
end
579582

0 commit comments

Comments
 (0)