From 61e9048e732f37f8bae2bbe16fe5bc37dd4a13c4 Mon Sep 17 00:00:00 2001 From: Redox Date: Tue, 21 May 2024 16:41:20 +0200 Subject: [PATCH] Fix NULL error --- lua/weapons/gmod_tool/stools/wire_adv.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/weapons/gmod_tool/stools/wire_adv.lua b/lua/weapons/gmod_tool/stools/wire_adv.lua index ac661c9ff4..74a3acc6d8 100644 --- a/lua/weapons/gmod_tool/stools/wire_adv.lua +++ b/lua/weapons/gmod_tool/stools/wire_adv.lua @@ -620,6 +620,11 @@ elseif CLIENT then end if self:GetStage() == 2 then + if not IsValid( self.CurrentEntity ) then + self:SetStage(0) + return + end + local _, outputs = self:GetPorts( self.CurrentEntity ) if alt then -- Auto wiring