KarlOfDuty / SCPDiscord

A Northwood plugin which adds remote interaction to an SCP:SL server through Discord.
https://karlofduty.com
GNU General Public License v3.0
12 stars 12 forks source link

[BUG] Error when banning a player #86

Closed EsserGaming closed 8 months ago

EsserGaming commented 1 year ago

Describing the bug:

When banning a player, an error occurs. I'm using CedMod to ban players.

The error:

[2023-07-07 20:10:35.894 +00:00] [Error] [PluginAPI] Failed executing event OnPlayerBanned (PlayerBanned) in plugin SCPDiscord.SCPDiscord
                                 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
                                   at SCPDiscord.EventListeners.ServerEventListener.OnPlayerBanned (PluginAPI.Events.PlayerBannedEvent ev) [0x0004b] in <705a1ba9d0234cdab40c4a89f3544fee>:0 
                                   at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception
                                   at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <05089c1b6989455fb1452c627044bac4>:0 
                                    --- End of inner exception stack trace ---
                                   at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <05089c1b6989455fb1452c627044bac4>:0 
                                   at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <05089c1b6989455fb1452c627044bac4>:0 
                                   at PluginAPI.Events.EventManager.ExecuteEvent[T] (PluginAPI.Events.IEventArguments args) [0x0018b] in <68f419240d7649ce9fb3250cb7a9424c>:0

Setup:

CBADavid commented 1 year ago

Can second this, happens at every ban. I'm simply using In-Game admin console to ban players, as well as the /ra command in discord to offline ban people.

KarlOfDuty commented 1 year ago

Hey, could you check if the bug is still happening in this build? https://jenkins.karlofduty.com/job/NWAPI/job/SCPDiscord/job/master/133/artifact/SCPDiscord.dll