NullReferenceException at CanBeTargetedSolved

Console is spamming to hell and back with

 Failed to call hook 'CanBeTargeted' on plugin 'InvisibleSleepers v1.0.3' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.InvisibleSleepers.CanBeTargeted (BaseCombatEntity entity) [0x00007] in <6d7c99542d054c3194a41bd7ddc6a0d0>:0 
  at Oxide.Plugins.InvisibleSleepers.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x000f4] in <6d7c99542d054c3194a41bd7ddc6a0d0>:0 
  at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0 
  at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0 
  at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
Thanks, will have a look today
I checked in again today after the server restart. No error. So I don't know what could have triggered the flood.
Hmm okay weird. I checked quickly on a test server and also the code and as far as I can see I should have checked for all null possibilities... For now gonna mark this as fixed, just hit me up if you get this error again
5cc8aded24c90.png collectvood
Hmm okay weird. I checked quickly on a test server and also the code and as far as I can see I should have checked for all null possibilities... For now gonna mark this as fixed, just hit me up if you get this error again

The BasePlayer is null most likely, else BasePlayer.UserIDString is, but likely the player as it isn't null-checked after the casting.

Will do.

I've been running this for just under two weeks now and this is the first time I'd seen this happen. As far as I could tell it wasn't messing with anything. Just figured it was worth bringing up.

Great plugin by the way. The sleeper count is reaching 380 on my build server and they're all out of the way. I wish I'd found this one sooner.

5c2d88ae4ea06.jpg Wulf

The BasePlayer is null most likely, else BasePlayer.UserIDString is, but likely the player as it isn't null-checked after the casting.

Oh yeah haha, was actually looking at CanNetworkTo but his error was in CanBeTargeted...

Locked automatically