Skip to content

Commit

Permalink
Do not throw when cancelling current token (#10021)
Browse files Browse the repository at this point in the history
  • Loading branch information
gerhardol committed Jun 30, 2022
1 parent 782e0cf commit bb78421
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion GitExtUtils/GitUI/CancellationTokenSequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ public void CancelCurrent()
// Calling Next() will cancel the current operation. Ignoring the return value means
// an unnecessary CancellationTokenSource is allocated, but it will not be leaked or
// otherwise interfere with the sequence.
Next();
try
{
Next();
}
catch (OperationCanceledException)
{
// No action
}
}

/// <summary>
Expand Down

0 comments on commit bb78421

Please sign in to comment.