Facepunch / garrysmod-issues

Garry's Mod issue tracker
147 stars 56 forks source link

Axis tool passing `false` into functions that'd normally take `entity` #5445

Closed wrefgtzweve closed 1 year ago

wrefgtzweve commented 1 year ago

Details

constraint.Axis can return false if the constraint wasn't created, whoever it seems like the axis tool doesn't account for that resulting in false being passed into AddCleanup and other functions.

https://github.com/Facepunch/garrysmod/blob/cb7ab3cc7bec244cd6874fe086e3b1aed9f77a6c/garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/stools/axis.lua#L85

https://github.com/Facepunch/garrysmod/blob/cb7ab3cc7bec244cd6874fe086e3b1aed9f77a6c/garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/stools/axis.lua#L92

This doesn't cause any errors as both functions have safeguards against it, i felt like it was worth making an issue for as its sorta unintended behavior regardless. I haven't checked other tools but i assume they might have the same issue.

robotboy655 commented 1 year ago

Handled here: https://github.com/Facepunch/garrysmod/commit/bbd09ac7d1d52c99ec68c4d447bcc882ada34279