From 76bfb7b66c4d5bb119657a5828ce9c8747618a8e Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 4 Apr 2026 04:43:33 +0300 Subject: [PATCH 1/2] Try to fix NULL errors --- lua/entities/gmod_wire_expression2/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/entities/gmod_wire_expression2/init.lua b/lua/entities/gmod_wire_expression2/init.lua index bd0885b9f8..13d657cebe 100644 --- a/lua/entities/gmod_wire_expression2/init.lua +++ b/lua/entities/gmod_wire_expression2/init.lua @@ -392,9 +392,9 @@ function ENT:OnRemove() end local owner = self.player + local chips = rawget(E2Lib.PlayerChips, owner) - if IsValid(owner) then - local chips = E2Lib.PlayerChips[owner] + if chips then chips:remove(self) if #chips == 0 then From 244d8565f1c09d757779e7e736f3e44d1ba75384 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 4 Apr 2026 04:49:14 +0300 Subject: [PATCH 2/2] Change it here too just in case --- lua/entities/gmod_wire_expression2/core/core.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/core.lua b/lua/entities/gmod_wire_expression2/core/core.lua index ddeebbf27d..ec44aa8014 100644 --- a/lua/entities/gmod_wire_expression2/core/core.lua +++ b/lua/entities/gmod_wire_expression2/core/core.lua @@ -217,7 +217,11 @@ e2function number totalCpuUsage() local owner = self.player if not IsValid(owner) then return self.timebench end - return E2Lib.PlayerChips[owner]:getTotalTime() + -- To avoid creating new table + local chips = rawget(E2Lib.PlayerChips, owner) + if not chips then return self.timebench end + + return chips:getTotalTime() end [nodiscard]