From f3da2126d63b51d5875a77fdc605461e3a94c9e1 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Mon, 6 Jul 2026 20:20:17 +0300 Subject: [PATCH] Fix lua error Fixes: ``` - lua/autorun/server/sv_cpp.lua:7: attempt to index a nil value 1. GetOwner - lua/autorun/server/sv_cpp.lua:7 2. CanTool - lua/autorun/sh_cpp.lua:5 3. RightClick - addons/wire/lua/wire/stools/hydraulic.lua:181 4. - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:273 ``` Not prop protection issue, it's because WireLib.CanTool pushes NULL ent --- lua/wire/stools/hydraulic.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/wire/stools/hydraulic.lua b/lua/wire/stools/hydraulic.lua index 9a39c3d28b..2871a6b33c 100644 --- a/lua/wire/stools/hydraulic.lua +++ b/lua/wire/stools/hydraulic.lua @@ -178,7 +178,7 @@ function TOOL:RightClick( trace ) end local trace2 = util.TraceLine( tr ) - if CLIENT or not WireLib.CanTool(self:GetOwner(), trace2.Entity, "wire_hydraulic") then return false end + if CLIENT or not trace2.Entity:IsValid() or not WireLib.CanTool(self:GetOwner(), trace2.Entity, "wire_hydraulic") then return false end return self:LeftClick(trace) and self:LeftClick(trace2) end