Skip to content

Commit

Permalink
AsyncDomExtensions - AndThen don't dispose if input null
Browse files Browse the repository at this point in the history
- Missed this one in last commit
  • Loading branch information
amaitland committed Nov 2, 2024
1 parent 534ef78 commit 5426ec5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions PuppeteerSharp.Dom/AsyncDomExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace PuppeteerSharp.Dom
Expand Down Expand Up @@ -211,7 +210,7 @@ public static async Task AndThen<TIn>(this Task<TIn> inputTask, Func<TIn, Task>

await func(input).ConfigureAwait(false);

if (dispose)
if (dispose && input != null)
{
await input.DisposeAsync().ConfigureAwait(false);
}
Expand Down

0 comments on commit 5426ec5

Please sign in to comment.