UseValueTasksCorrectlyAnalyzer throws ArgumentNullException #3642
Labels
Area-Microsoft.CodeAnalysis.NetAnalyzers
Bug
The product is not behaving according to its current intended design
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers
Package Version
v3.0.0 (Latest)
Diagnostic ID
CA2012 UseValueTasksCorrectlyAnalyzer
Repro steps
Expected behavior
UseValueTasksCorrectly should not throw.
Actual behavior
An async method with a guard clause that throws an exception in combination with storing
ValueTask
in a variable causes UseValueTasksCorrectlyAnalyzer to throwArgumentNullException
.It seems that
block.FallThroughSuccessor.Destination
isnull
when handling the fall through successor since it is a throw expression which results in the call toseen.TryGetValue
throwArgumentNullException
because the key is a null value.The text was updated successfully, but these errors were encountered: