From 534ef7812ff6d61a5fc92d5a70dd3569e6275eb8 Mon Sep 17 00:00:00 2001 From: amaitland <307872+amaitland@users.noreply.github.com> Date: Sat, 2 Nov 2024 13:19:30 +1000 Subject: [PATCH] AsyncDomExtensions - AndThen don't dispose if input null --- PuppeteerSharp.Dom/AsyncDomExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PuppeteerSharp.Dom/AsyncDomExtensions.cs b/PuppeteerSharp.Dom/AsyncDomExtensions.cs index f949459..77553d9 100644 --- a/PuppeteerSharp.Dom/AsyncDomExtensions.cs +++ b/PuppeteerSharp.Dom/AsyncDomExtensions.cs @@ -164,7 +164,7 @@ public static async Task AndThen(this Task inputTask, Func var result = await func(input).ConfigureAwait(false); - if (dispose) + if (dispose && input != null) { await input.DisposeAsync().ConfigureAwait(false); }