Skip to content

Commit

Permalink
Added an extra check to ENT:GetLinks()
Browse files Browse the repository at this point in the history
- In some cases, you could use ENT:GetLinks() on entities that were never linked before, now we'll make sure that's the case before copying that table.
  • Loading branch information
TwistedTail committed Jun 23, 2024
1 parent 2aafe1b commit 0a31f7e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/cfw/classes/link_sv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ do
end

function ENT:GetLinks() -- Creates a shallow copy of the links table
local out = {}
local links = self._links
local out = {}

for k, v in pairs(self._links) do
out[k] = v
if links then
for k, v in pairs(links) do
out[k] = v
end
end

return out
Expand Down

0 comments on commit 0a31f7e

Please sign in to comment.