Open Incapamentum opened 1 year ago
Unsure if this stack trace dump is related to this error, but to keep the possibility open, I'll be including it in this issue. If it turns out to be a separate and unique error from this one, a new issue will be opened.
23:15:15 Gateway A MessageReceived handler has thrown an unhandled exception.:
System.NullReferenceException: Object reference not set to an instance of an object.
at Bot.Handlers.MessageEventHandler.MessageReceivedAsync(SocketMessage message) in C:\Workspaces\Visual-Studio\Exalted-Sage\New\bot\Handlers\MessageEventHandler.cs:line 91
at Discord.EventExtensions.InvokeAsync[T](AsyncEvent`1 eventHandler, T arg)
at Discord.WebSocket.DiscordSocketClient.TimeoutWrap(String name, Func`1 action)
This error still appears, even with moving to a new VPS service. Still unsure how to reproduce the error in dev, but will have to consider different things.
18:59:09 Gateway A MessageReceived handler has thrown an unhandled exception.:
System.NullReferenceException: Object reference not set to an instance of an object.
at Bot.Handlers.MessageEventHandler.MessageReceivedAsync(SocketMessage message) in /home/runner/work/Exalted-Sage/Exalted-Sage/New/bot/Handlers/MessageEventHandler.cs:line 91
at Discord.EventExtensions.InvokeAsync[T](AsyncEvent`1 eventHandler, T arg)
at Discord.WebSocket.DiscordSocketClient.TimeoutWrap(String name, Func`1 action)
Note: the code for this particular bug has changed, although I suspect that the issue persists.
The other day I actually took note that the error only comes up whenever a message is sent through a thread. If that's the case, a fix for this would be to simply exclude all messages originating from threads.
A
System.NullReferenceException
is being thrown within theMessageRecived
handler (i.e. theMessageEventHandler
class). This line of code seems to be where the error is occuring.Happens infrequently, but currently I suspect the cause of it may be that it's attempting to grab the ID of a non-existent category(?) or something without a channel. May be difficult to reproduce.
Image of stack trace is included:![MessageEventHandler_l69](https://user-images.githubusercontent.com/17144795/198845566-d30b2f91-469b-459c-82c0-939612779d1f.png)