NullReferenceException at PlayerDatabase_ExecuteBanError

I wasn't able to ban myself while testing, this is the error message.

[EnhancedBanSystem] at Oxide.Plugins.EnhancedBanSystem.PlayerDatabase_ExecuteBan (Oxide.Plugins.EnhancedBanSystem+BanData bandata) [0x0002d] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.ExecuteBan (System.Object source, Oxide.Plugins.EnhancedBanSystem+BanData bandata, System.Boolean kick) [0x0003a] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.PrepareBan (System.Object source, System.String userID, System.String name, System.String ip, System.String reason, System.Double duration, System.Boolean kick) [0x0000f] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.BanPlayer (System.Object source, Oxide.Core.Libraries.Covalence.IPlayer player, System.String reason, System.Double duration) [0x00016] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.TryBan (System.Object source, System.String[] args) [0x0011a] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.cmdBan (Oxide.Core.Libraries.Covalence.IPlayer player, System.String command, System.String[] args) [0x00067] in <bf7549f762ee4caaa0249e3c150a1299>:0
Could you provide the top of that error please? That is only a portion of it.


@Wulf, I could. But the only reason I didn't in the first place was because that's the only error message related to the Enhanced Ban System Plug-in. Is there any other things I could provide ?

(As a disclaimer, the banned was issued at 16:44)

(16:44:05) | ERROR:Object reference not set to an instance of an object
(16:44:05) | [EnhancedBanSystem] at Oxide.Plugins.EnhancedBanSystem.PlayerDatabase_ExecuteBan (Oxide.Plugins.EnhancedBanSystem+BanData bandata) [0x0002d] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.ExecuteBan (System.Object source, Oxide.Plugins.EnhancedBanSystem+BanData bandata, System.Boolean kick) [0x0003a] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.PrepareBan (System.Object source, System.String userID, System.String name, System.String ip, System.String reason, System.Double duration, System.Boolean kick) [0x0000f] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.BanPlayer (System.Object source, Oxide.Core.Libraries.Covalence.IPlayer player, System.String reason, System.Double duration) [0x00016] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.TryBan (System.Object source, System.String[] args) [0x0011a] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.cmdBan (Oxide.Core.Libraries.Covalence.IPlayer player, System.String command, System.String[] args) [0x00067] in <bf7549f762ee4caaa0249e3c150a1299>:0

In addition to that, I have seen this message pop up randomly 

Failed to call hook 'CanUserLogin' on plugin 'EnhancedBanSystem v5.2.3' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.EnhancedBanSystem.PlayerDatabase_IsBanned (System.String steamid, System.String ip, Oxide.Plugins.EnhancedBanSystem+BanData& bandata) [0x0002f] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.isBanned_NonDelayed (System.String name, System.String steamid, System.String ip, System.Boolean update, Oxide.Plugins.EnhancedBanSystem+BanData& bandata) [0x0006b] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.CanUserLogin (System.String name, System.String id, System.String ip) [0x00012] in <bf7549f762ee4caaa0249e3c150a1299>:0
at Oxide.Plugins.EnhancedBanSystem.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x01523] in <bf7549f762ee4caaa0249e3c150a1299>: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​

Edit: Found solution, Restart server. Delete config. Reload the plugin. and try again.

Hey, been trying to fix this issue for hours, i've tried everything I could think of, nothing seems to want to fix it. 

The error in console: 

[Enhanced Ban System] at Oxide.Plugins.EnhancedBanSystem.PlayerDatabase_ExecuteBan (Oxide.Plugins.EnhancedBanSystem+BanData bandata) [0x0002d] in <9e9829d98e6940078e3adc314291e869>:0
at Oxide.Plugins.EnhancedBanSystem.ExecuteBan (System.Object source, Oxide.Plugins.EnhancedBanSystem+BanData bandata, System.Boolean kick) [0x0003a] in <9e9829d98e6940078e3adc314291e869>:0
at Oxide.Plugins.EnhancedBanSystem.PrepareBan (System.Object source, System.String userID, System.String name, System.String ip, System.String reason, System.Double duration, System.Boolean kick) [0x0000f] in <9e9829d98e6940078e3adc314291e869>:0
at Oxide.Plugins.EnhancedBanSystem.BanPlayer (System.Object source, Oxide.Core.Libraries.Covalence.IPlayer player, System.String reason, System.Double duration) [0x00016] in <9e9829d98e6940078e3adc314291e869>:0
at Oxide.Plugins.EnhancedBanSystem.TryBan (System.Object source, System.String[] args) [0x0011a] in <9e9829d98e6940078e3adc314291e869>:0
at Oxide.Plugins.EnhancedBanSystem.cmdBan (Oxide.Core.Libraries.Covalence.IPlayer player, System.String command, System.String[] args) [0x00067] in <9e9829d98e6940078e3adc314291e869>:0

The Error in game: 

ERROR: Object reference not set to an instance of an object

Any advice helps! I've legit tried everything, and I can only find one other person who had this issue on this forum but his solution did not work either. 

Im having the same issue, ive read along and seen you restarted the server and deleted the config. But what config file did you delete?

This is what I get when Trying to ban!!

(22:57:12) | [Enhanced Ban System]   at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () [0x00000] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) [0x00043] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000d9] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00053] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <45c13f2b01574d8b82248736e42013a4>:0 
  at Oxide.Plugins.EnhancedBanSystem.PlayerDatabase_ExecuteBan (Oxide.Plugins.EnhancedBanSystem+BanData bandata) [0x00065] in <3a1f8217ad784f118b6a3da09aa4c768>:0 
  at Oxide.Plugins.EnhancedBanSystem.ExecuteBan (System.Object source, Oxide.Plugins.EnhancedBanSystem+BanData bandata, System.Boolean kick) [0x0003a] in <3a1f8217ad784f118b6a3da09aa4c768>:0 
  at Oxide.Plugins.EnhancedBanSystem.PrepareBan (System.Object source, System.String userID, System.String name, System.String ip, System.String reason, System.Double duration, System.Boolean kick) [0x0000f] in <3a1f8217ad784f118b6a3da09aa4c768>:0 
  at Oxide.Plugins.EnhancedBanSystem.BanPlayer (System.Object source, Oxide.Core.Libraries.Covalence.IPlayer player, System.String reason, System.Double duration) [0x00016] in <3a1f8217ad784f118b6a3da09aa4c768>:0 
  at Oxide.Plugins.EnhancedBanSystem.TryBan (System.Object source, System.String[] args) [0x0011a] in <3a1f8217ad784f118b6a3da09aa4c768>:0 
  at Oxide.Plugins.EnhancedBanSystem.cmdBan (Oxide.Core.Libraries.Covalence.IPlayer player, System.String command, System.String[] args) [0x00067] in <3a1f8217ad784f118b6a3da09aa4c768>:0


Merged post

By Removing PlayerDatabase the loading message went away, Still getting same message for trying to ban