wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
547 stars 332 forks source link

Fix wire_adv tool NULL error #3079

Closed wrefgtzweve closed 1 month ago

wrefgtzweve commented 1 month ago

Fixes

[wire] addons/wire/lua/wire/wireshared.lua:437: attempt to index local 'entTbl' (a nil value)
  1. HasPorts - addons/wire/lua/wire/wireshared.lua:437
   2. func - addons/wire/lua/weapons/gmod_tool/stools/wire_adv.lua:1275
    3. unknown - addons/ulib/lua/includes/modules/hook.lua:260

Which happens because :GetTable() returns a nil on NULL entities. In this case the trace traceResult can return a NULL ent when the trace doesn't ever hit anything thus causing this error.