Failed to call hook 'CanLock' ErrorSolved

Since i wiped my server today i'm seeing this error in my console.

 

 Failed to call hook 'CanLock' on plugin 'MasterKey v0.7.1' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.MasterKey.CanLock (BasePlayer player, BaseLock lock) [0x0011b] in <6b27ead145f34848ab723689207a1387>:0 
  at Oxide.Plugins.MasterKey.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00333] in <6b27ead145f34848ab723689207a1387>: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
I have put out a potentional fix, however I can't seem to recreate that error, did it occour more than once?
In response to Tori1157 ():
I have put out a potentional fix, however I can't seem to recreate that error, did it occour more th...

The error i still active

It happens when i put a code lock on the door and close the lock.

 

Failed to call hook 'CanLock' on plugin 'MasterKey v0.7.2' (NullReferenceException: Object reference not set to an instance of an object)
  at Oxide.Plugins.MasterKey.CanLock (BasePlayer player, BaseLock lock) [0x00135] in <e5ce8a7968504ec3ac11e0ce1c27a814>:0 
  at Oxide.Plugins.MasterKey.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00333] in <e5ce8a7968504ec3ac11e0ce1c27a814>: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
I still seem to not be able to recreate the issue, you can't lock a codelock unless it has a code, so i am not able to do what you're describing here. Would you perhaps have a different plugin that changes anything with code locks?

Would you be able to provide a video or more information on this issue?
In response to Tori1157 ():
I still seem to not be able to recreate the issue, you can't lock a codelock unless it has a code, s...
There are a few null checks that should be added...
  • @lock.parentEntity => parentEntity could be null, should check before trying to use
  • prefab usage in loop => could be null if the above is null when setting var prefab
  • @lock and codeLock => could be null if the lock was destroyed before the plugin finished using it
  • new Effect(codeLock.effectLocked.resourcePath => could be null if invalid, should create Effect and null check before trying to send
In response to Tori1157 ():
I still seem to not be able to recreate the issue, you can't lock a codelock unless it has a code, s...
The error only is showing when im using a Key Lock "lock for solo players" When i close the lock the error comes.
Locked automatically