(15:18:41) | Failed to call hook 'CanLootPlayer' on plugin 'PreventLooting v1.10.1' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.PreventLooting.IsFriend (System.UInt64 friendid, System.UInt64 playerid) [0x00064] in <8742f4fcdb90462485aa6f05e9351c5f>:0
at Oxide.Plugins.PreventLooting.CanLootPlayer (BasePlayer target, BasePlayer player) [0x0001c] in <8742f4fcdb90462485aa6f05e9351c5f>:0
at Oxide.Plugins.PreventLooting.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00697] in <8742f4fcdb90462485aa6f05e9351c5f>: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 NullReferenceException at IsFriendFixed
I tested the plugin on a test server and everything works fine.
Failed to call hook 'CanLootPlayer' on plugin 'PreventLooting v1.11.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.PreventLooting.IsFriend (System.UInt64 friendid, System.UInt64 playerid) [0x00064] in <3f9a1a35843e42dc93e49a21b9dfcf9b>:0
at Oxide.Plugins.PreventLooting.CanLootPlayer (BasePlayer target, BasePlayer player) [0x0001c] in <3f9a1a35843e42dc93e49a21b9dfcf9b>:0
at Oxide.Plugins.PreventLooting.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x006cc] in <3f9a1a35843e42dc93e49a21b9dfcf9b>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <98321e516fc1420ea57d4d2088213a59>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <ac41dd3599754d448b8c218b34645820>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <ac41dd3599754d448b8c218b34645820>:0 CaseMan
I tested the plugin on a test server and everything works fine.
Looks like you aren't null checking this in the IsFriend method:
BasePlayer player = BasePlayer.FindByID(playerid);
Wulf
Looks like you aren't null checking this in the IsFriend method:
BasePlayer player = BasePlayer.FindByID(playerid);
Yes it is possible. If multiple plugins use the same hook, there may be null values in the hook arguments. I will add null check in the near future.
Locked automatically