From 0a31f7e20c080f3ec93819b13a9338e605b2068c Mon Sep 17 00:00:00 2001 From: TwistedTail <8784231+TwistedTail@users.noreply.github.com> Date: Sun, 23 Jun 2024 03:52:18 -0400 Subject: [PATCH] Added an extra check to ENT:GetLinks() - 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. --- lua/cfw/classes/link_sv.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/cfw/classes/link_sv.lua b/lua/cfw/classes/link_sv.lua index 32e1d87..6f2142a 100644 --- a/lua/cfw/classes/link_sv.lua +++ b/lua/cfw/classes/link_sv.lua @@ -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