From 2a4a762071f89670eb7523683226ca611f33ebef Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 20 Sep 2026 19:31:26 +0300 Subject: [PATCH 1/5] Don't send config if owner is invalid Fixes: ``` - addons/wire/lua/wire/server/wirelib.lua:1650: attempt to call method 'SteamID' (a nil value) 1. CheckFont - addons/wire/lua/wire/server/wirelib.lua:1650 2. SendConfig - addons/wire/lua/entities/gmod_wire_textscreen.lua:282 3. Retransmit - addons/wire/lua/entities/gmod_wire_textscreen.lua:306 4. func - addons/wire/lua/wire/wireshared.lua:543 5. - lua/includes/extensions/net.lua:34 ``` --- lua/entities/gmod_wire_textscreen.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_textscreen.lua b/lua/entities/gmod_wire_textscreen.lua index 779eff725d..9b01a3ec6a 100644 --- a/lua/entities/gmod_wire_textscreen.lua +++ b/lua/entities/gmod_wire_textscreen.lua @@ -274,12 +274,15 @@ function ENT:Think() end function ENT:SendConfig(ply) + local ply = self:GetPlayer() + if not ply:IsValid() then return end + self.doSendConfig = false local font = string.sub(self.tfont, 0, 31) local size = self.chrPerLine - if not WireLib.CheckFont(font .. math.floor(760 / size), self:GetPlayer()) then + if not WireLib.CheckFont(font .. math.floor(760 / size), ply) then font = "Arial" size = 10 end From f3c71b6ff24ab6941ae1c32d5b5e55919baac7f9 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 20 Sep 2026 19:40:46 +0300 Subject: [PATCH 2/5] Fix lot of WireLib.CanTool NULL errors --- lua/entities/gmod_wire_colorer.lua | 5 ++++- lua/entities/gmod_wire_exit_point.lua | 7 ++++++- lua/entities/gmod_wire_grabber.lua | 4 +++- lua/entities/gmod_wire_materializer.lua | 8 ++++++-- lua/entities/gmod_wire_nailer.lua | 4 +++- lua/entities/gmod_wire_pod.lua | 5 ++++- lua/entities/gmod_wire_vehicle.lua | 5 ++++- 7 files changed, 30 insertions(+), 8 deletions(-) diff --git a/lua/entities/gmod_wire_colorer.lua b/lua/entities/gmod_wire_colorer.lua index 38404524fd..20e46669b2 100644 --- a/lua/entities/gmod_wire_colorer.lua +++ b/lua/entities/gmod_wire_colorer.lua @@ -121,7 +121,10 @@ function ENT:TriggerInput(iname, value) filter = { self } } if not IsValid(trace.Entity) then return end - if not WireLib.CanTool(self:GetPlayer(), trace.Entity, "colour") then return end + + local ply = self:GetPlayer() + if not ply:IsValid() then return end + if not WireLib.CanTool(ply, trace.Entity, "colour") then return end if trace.Entity:IsPlayer() then trace.Entity:SetColor(Color(self.InColor.r, self.InColor.g, self.InColor.b, 255)) diff --git a/lua/entities/gmod_wire_exit_point.lua b/lua/entities/gmod_wire_exit_point.lua index 1e2c8f8e46..ceb2232c13 100644 --- a/lua/entities/gmod_wire_exit_point.lua +++ b/lua/entities/gmod_wire_exit_point.lua @@ -68,7 +68,12 @@ end function ENT:CheckPP(ent) -- Check Prop Protection. Most block/allow all of CanTool, but lets check hoverdrive controller specifically, since if they can attach one to your vehicle, they can simulate this anyways - return IsValid(ent) and WireLib.CanTool(self:GetPlayer(), ent, "wire_hoverdrivecontroller") + if not IsValid(ent) then return false end + + local ply = self:GetPlayer() + if not ply:IsValid() then return false end + + return WireLib.CanTool(ply, ent, "wire_hoverdrivecontroller") end function ENT:Think() diff --git a/lua/entities/gmod_wire_grabber.lua b/lua/entities/gmod_wire_grabber.lua index d28e858b6b..2c57e68557 100644 --- a/lua/entities/gmod_wire_grabber.lua +++ b/lua/entities/gmod_wire_grabber.lua @@ -81,7 +81,9 @@ function ENT:CanGrab(trace) -- If there's no physics object then we can't constraint it! if not util.IsValidPhysicsObject(trace.Entity, trace.PhysicsBone) then return false end - if not WireLib.CanTool(self:GetPlayer(), trace.Entity, "weld") then return false end + local ply = self:GetPlayer() + if not ply:IsValid() then return false end + if not WireLib.CanTool(ply, trace.Entity, "weld") then return false end return true end diff --git a/lua/entities/gmod_wire_materializer.lua b/lua/entities/gmod_wire_materializer.lua index e71b93eca2..2d871819a7 100644 --- a/lua/entities/gmod_wire_materializer.lua +++ b/lua/entities/gmod_wire_materializer.lua @@ -34,8 +34,12 @@ function ENT:TriggerInput(iname, value) filter = self }).Entity - if ent:IsValid() and WireLib.CanTool(self:GetPlayer(), ent, "material") then - E2Lib.setMaterial(ent, self.Material) + if ent:IsValid() then + local ply = self:GetPlayer() + + if ply:IsValid() and WireLib.CanTool(ply, ent, "material") then + E2Lib.setMaterial(ent, self.Material) + end end end elseif iname == "Length" then diff --git a/lua/entities/gmod_wire_nailer.lua b/lua/entities/gmod_wire_nailer.lua index 7be194588e..799fd9984c 100644 --- a/lua/entities/gmod_wire_nailer.lua +++ b/lua/entities/gmod_wire_nailer.lua @@ -32,7 +32,9 @@ function ENT:CanNail(trace) -- If there's no physics object then we can't constraint it! if not util.IsValidPhysicsObject(trace.Entity, trace.PhysicsBone) then return false end -- The nailer tool no longer exists, but we ask for permission under its name anyway - if not WireLib.CanTool(self:GetPlayer(), trace.Entity, "nailer" ) then return false end + local ply = self:GetPlayer() + if not ply:IsValid() then return false end + if not WireLib.CanTool(ply, trace.Entity, "nailer" ) then return false end return true end diff --git a/lua/entities/gmod_wire_pod.lua b/lua/entities/gmod_wire_pod.lua index 0253717190..9f2ba0dec4 100644 --- a/lua/entities/gmod_wire_pod.lua +++ b/lua/entities/gmod_wire_pod.lua @@ -237,7 +237,10 @@ function ENT:LinkEnt(pod) -- if pod is still not a vehicle even after all of the above, then error out if not IsValid(pod) or not pod:IsVehicle() then return false, "Must link to a vehicle" end - if not WireLib.CanTool(self:GetPlayer(), pod, "wire_pod") then return false, "You do not have permission to access this vehicle" end + + local ply = self:GetPlayer() + if not ply:IsValid() then return false, "Owner is invalid" + if not WireLib.CanTool(ply, pod, "wire_pod") then return false, "You do not have permission to access this vehicle" end self:SetPod(pod) WireLib.SendMarks(self, { pod }) diff --git a/lua/entities/gmod_wire_vehicle.lua b/lua/entities/gmod_wire_vehicle.lua index ca772c0fff..71c9e0262e 100644 --- a/lua/entities/gmod_wire_vehicle.lua +++ b/lua/entities/gmod_wire_vehicle.lua @@ -18,7 +18,10 @@ function ENT:LinkEnt( pod ) pod = WireLib.GetClosestRealVehicle(pod,self:GetPos(),self:GetPlayer()) if not IsValid(pod) or not pod:IsVehicle() then return false, "Must link to a vehicle" end - if not WireLib.CanTool(self:GetPlayer(), pod, "wire_vehicle") then return false, "You do not have permission to access this vehicle" end + + local ply = self:GetPlayer() + if not ply:IsValid() then return false, "Owner is invalid" + if not WireLib.CanTool(ply, pod, "wire_vehicle") then return false, "You do not have permission to access this vehicle" end self.Vehicle = pod WireLib.SendMarks(self, {pod}) From 72805405eac1e9157310f731aff21a906fa4316e Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 20 Sep 2026 20:00:22 +0300 Subject: [PATCH 3/5] Fix syntax error --- lua/entities/gmod_wire_vehicle.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_vehicle.lua b/lua/entities/gmod_wire_vehicle.lua index 71c9e0262e..afae4dcd3f 100644 --- a/lua/entities/gmod_wire_vehicle.lua +++ b/lua/entities/gmod_wire_vehicle.lua @@ -20,7 +20,7 @@ function ENT:LinkEnt( pod ) if not IsValid(pod) or not pod:IsVehicle() then return false, "Must link to a vehicle" end local ply = self:GetPlayer() - if not ply:IsValid() then return false, "Owner is invalid" + if not ply:IsValid() then return false, "Owner is invalid" end if not WireLib.CanTool(ply, pod, "wire_vehicle") then return false, "You do not have permission to access this vehicle" end self.Vehicle = pod From 838067a98c9894941e6dc53efcf965d78b36f7f1 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sun, 20 Sep 2026 20:01:22 +0300 Subject: [PATCH 4/5] And this too --- lua/entities/gmod_wire_pod.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_pod.lua b/lua/entities/gmod_wire_pod.lua index 9f2ba0dec4..3cd35610ba 100644 --- a/lua/entities/gmod_wire_pod.lua +++ b/lua/entities/gmod_wire_pod.lua @@ -239,7 +239,7 @@ function ENT:LinkEnt(pod) if not IsValid(pod) or not pod:IsVehicle() then return false, "Must link to a vehicle" end local ply = self:GetPlayer() - if not ply:IsValid() then return false, "Owner is invalid" + if not ply:IsValid() then return false, "Owner is invalid" end if not WireLib.CanTool(ply, pod, "wire_pod") then return false, "You do not have permission to access this vehicle" end self:SetPod(pod) From 1a90da9795fdc517468c1d2d4f3e48f875235b6f Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Mon, 21 Sep 2026 14:59:19 +0300 Subject: [PATCH 5/5] Fix typo --- lua/entities/gmod_wire_expression2/core/egpfunctions.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua index d466df3350..25f9142f07 100644 --- a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua +++ b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua @@ -255,7 +255,7 @@ end -- Font ---------------------------- local function canCreateFont( ply, font, size ) - return WireLib.CanFont(font .. (size or 18), ply) + return WireLib.CheckFont(font .. (size or 18), ply) end e2function void wirelink:egpFont( number index, string font )