ArgumentNullException thrown by Dispatcher.RunAsync
Hong
1,211
Reputation points
if (dispatcher == null)
{
//do nothing
}
else
{
await dispatcher?.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
try
{
...
}
catch (Exception ex)
{
}
});
}
The above code occasionally throws the following exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: source
Stack Trace:
at System.WindowsRuntimeSystemExtensions.AsTask(IAsyncAction, CancellationToken) + 0x47
It is actually fairly frequent. I cannot reproduce it. It is reported by app analytics. Could anyone shed some light on this?
Sign in to answer