Skip to content

Commit 48bd60c

Browse files
committed
Fixed validation
1 parent 0cb6a6a commit 48bd60c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/DotNext/Threading/Tasks/Conversion.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ public static async Task<TOutput> Convert<TInput, TOutput>(this Task<TInput> tas
7373
/// <param name="task">The task to convert.</param>
7474
/// <typeparam name="T">The type of the task.</typeparam>
7575
/// <returns>The task that never throws an exception. Instead, the <see cref="Result{T}"/> contains an exception.</returns>
76-
public static AwaitableResult<T> SuspendException<T>(this Task<T> task) => new(task);
76+
public static AwaitableResult<T> SuspendException<T>(this Task<T> task)
77+
{
78+
ArgumentNullException.ThrowIfNull(task);
79+
80+
return new(task);
81+
}
7782

7883
/// <summary>
7984
/// Suspends the exception that can be raised by the task.

0 commit comments

Comments
 (0)