abnerfs / cs2-rockthevote

General purpose cs2 map voting plugin, made with love from scratch
88 stars 28 forks source link

Error invoking callback when typing timeleft from server console #35

Closed BoTo-sg closed 6 months ago

BoTo-sg commented 6 months ago

timeleft 00:29:21 [EROR] (cssharp:Core) Error invoking callback 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 cs2_rockthevote.TimeLeftCommand.CommandHandler(CCSPlayerController player) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/TimeLeftCommand.cs:line 86 at cs2_rockthevote.Plugin.OnTimeLeft(CCSPlayerController player, CommandInfo command) in /home/runner/work/cs2-rockthevote/cs2-rockthevote/Features/TimeLeftCommand.cs:line 15 at CounterStrikeSharp.API.Core.Commands.CommandManager.HandleCommandInternal(Int32 playerSlot, IntPtr commandInfo) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/Commands/CommandManager.cs:line 162 at InvokeStub_Action`2.Invoke(Object, Object, IntPtr) at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, BindingFlags invokeAttr) --- End of inner exception stack trace --- at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr args, BindingFlags invokeAttr) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Delegate.DynamicInvokeImpl(Object[] args) at CounterStrikeSharp.API.Core.FunctionReference.<>c__DisplayClass7_0.<.ctor>b__0(fxScriptContext context) in /home/runner/work/CounterStrikeSharp/CounterStrikeSharp/managed/CounterStrikeSharp.API/Core/FunctionReference.cs:line 106 Time Remaining: 0:33

abnerfs commented 6 months ago

Commands are not ready to be invoked from server's console, I will handle it

abnerfs commented 6 months ago

This should fix it: https://github.com/abnerfs/cs2-rockthevote/releases/tag/v1.7.6