Skip to content

Commit

Permalink
A little more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bfarmer67 committed Sep 5, 2024
1 parent 80fb76a commit f978488
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hyperbee.AsyncExpressions/StateMachineBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ private static bool TryGetAwaiterType( Expression expr, out Type awaiterType )

static Type GetAwaiterType( Type taskType )
{
var genericArgument = taskType.IsGenericType ? taskType.GetGenericArguments()[0] : typeof(void);
var genericArgument = taskType.IsGenericType ? taskType.GetGenericArguments()[0] : null;

if ( genericArgument == typeof(void) || genericArgument.FullName == "System.Threading.Tasks.VoidTaskResult" )
if ( genericArgument == null || genericArgument.FullName == "System.Threading.Tasks.VoidTaskResult" )
{
return typeof(ConfiguredTaskAwaitable.ConfiguredTaskAwaiter);
}
Expand Down

0 comments on commit f978488

Please sign in to comment.