NullReferenceException when using InteractivityExtension.WaitForEventArgsAsync<T>(Func<T, bool> predicate)
See original GitHub issueHello, these errors are occurring every time a user interacts with components “catched” by a InteractivityExtension.WaitForEventArgsAsync<T>(Func<T, bool> predicate):
[2021-10-17 02:02:12 -03:00] [104 /EventHandler] [Error] Event handler exception for event COMPONENT_INTERACTED thrown from System.Threading.Tasks.Task HandleEvent(DSharpPlus.DiscordClient, DSharpPlus.EventArgs.ComponentInteractionCreateEventArgs) (defined in DSharpPlus.Interactivity.EventHandling.EventWaiter`1[DSharpPlus.EventArgs.ComponentInteractionCreateEventArgs])
System.NullReferenceException: Object reference not set to an instance of an object.
at DSharpPlus.Interactivity.EventHandling.EventWaiter`1.HandleEvent(DiscordClient client, T eventargs)
at Emzi0767.Utilities.AsyncEvent`2.InvokeAsync(TSender sender, TArgs e, AsyncEventExceptionMode exceptionMode)
[2021-10-17 02:02:12 -03:00] [42 /HossamBot ] [Error] Exception occured
System.NullReferenceException: Object reference not set to an instance of an object.
at DSharpPlus.Interactivity.EventHandling.EventWaiter`1.HandleEvent(DiscordClient client, T eventargs)
at Emzi0767.Utilities.AsyncEvent`2.InvokeAsync(TSender sender, TArgs e, AsyncEventExceptionMode exceptionMode)
I’m using the ComponentInteractionCreateEventArgs
for the parameters T
and p => p?.Message?.Id == msgId
for the predicate
.
The args is returned fine, but the log screen has a lot of these errors.
v4.1.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
c# - Invoking a predicate throws NullReferenceException
I can't find a property to check against the nullity of the current provider, whether on the Func<T,bool> or the Expression<Func<Media,T>> . Do ......
Read more >C# Task - LazyAsyncResult - NullReferenceException
You are using async/await so when something goes wrong inside the auto-generated code to support this the debugger throws you into the framework ......
Read more >[Solved] Calling public boolean function with return leads ...
I call a public bool function from a script. private ... Calling public boolean function with return leads to NullReferenceException.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe this was fixed in #1230.
That’s a bit outdated (we’re at 4.3.0 nightlies now) but I don’t think there has been any change to it. I’ll look into it at some point