Skip to content

Commit b1c0629

Browse files
committed
WaitTask - Add Cleanup exception handling
1 parent 8397767 commit b1c0629

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

lib/PuppeteerSharp/WaitTask.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,14 @@ private void Cleanup()
220220
{
221221
if (!_cts.IsCancellationRequested)
222222
{
223-
_cts.Cancel();
223+
try
224+
{
225+
_cts.Cancel();
226+
}
227+
catch
228+
{
229+
// Ignore as we're cleanining up
230+
}
224231
}
225232
_world.WaitTasks.Remove(this);
226233
}

0 commit comments

Comments
 (0)