NullReferenceException at OnEntityTakeDamageError
What could cause this problem? It started with 4300 oxide.

 

Failed to call hook 'OnEntityTakeDamage' on plugin 
'Arkan v1.0.10' (NullReferenceException: Object reference not set to an 
instance of an object)
at Oxide.Plugins.Arkan.OnEntityTakeDamage (BasePlayer entity, HitInfo info) [0x00101] in <1058952921cd4582812b3c0f99a02e43>:0

at Oxide.Plugins.Arkan.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00596] in <1058952921cd4582812b3c0f99a02e43>: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
 
Hmm, strange. I can not get the same error. I tried both with the version of Oxide for Windows(2.0.4300) and so with the version for Linux(2.0.4299). It looks like one of the parameters is null. I tried everywhere to add a null check. Maybe I missed something.
5d5132d656818.png Antidote
Hmm, strange. I can not get the same error. I tried both with the version of Oxide for Windows(2.0.4300) and so with the version for Linux(2.0.4299). It looks like one of the parameters is null. I tried everywhere to add a null check. Maybe I missed something.
The hook hasn't changed. You aren't null checking HitInfo.Initiator though, you're only checking if it's a BasePlayer; that's most likely where it is as there isn't always an Initiator.
Most likely it is. Thanks Wulf. I will add a null-check for HitInfo.Initiator in the next update. To get rid of this error now, you need to make changes to the OnEntityTakeDamage hook code:

        private void OnEntityTakeDamage(BasePlayer entity, HitInfo info)
        {
            if (isDetectAIM)
            {
                if (entity == null) return;
				
                if (info == null) return;
				
				if (info.Initiator == null) return;
				
                if (!(info.Initiator is BasePlayer)) return;
				
                BasePlayer attacker = info.Initiator.ToPlayer();​
I'll try and see.Thank you

Merged post

Again :/

Failed to call hook 'OnEntityTakeDamage' on plugin 
'Arkan v1.0.10' (NullReferenceException: Object reference not set to an 
instance of an object)
at Oxide.Plugins.Arkan.OnEntityTakeDamage (BasePlayer entity, HitInfo info) [0x00113] in <8ff6bd52bfaa4c439328a7afefc28336>:0

at Oxide.Plugins.Arkan.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00596] in <8ff6bd52bfaa4c439328a7afefc28336>: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
 
Let's try adding a null check for HitInfo.HitBone.
        private void OnEntityTakeDamage(BasePlayer entity, HitInfo info)
        {
            if (isDetectAIM)
            {
                if (entity == null) return;
				
                if (info == null) return;
				
                if (info.Initiator == null) return;
				
                if (!(info.Initiator is BasePlayer)) return;
				
                BasePlayer attacker = info.Initiator.ToPlayer();
				
                if (attacker == null) return;
				
                if (attacker is NPCPlayer) return;
				
                if (IsNPC(attacker)) return;

                if (!PlayersFiredProjectlesData.ContainsKey(attacker.userID))
                    return;

                if (info.Initiator.Distance(entity.transform.position) > minDistanceAIMCheck)
                {                    
                    if (info.HitBone == null) return;
					
                    var _bodyPart = entity?.skeletonProperties?.FindBone(info.HitBone)?.name?.english ?? "";​
did not help: / still the same error.I'm wondering what plugin it does not agree with, but nothing comes to mind.If you have a discord we can write there. @paulsimik#0506