There's some sort of race condition where if you press the cancel button on the progress dialog and then dispose it, a null reference exception will occur in _backgroundWorker_ProgressChanged where it tries to cancel the field, _cancellationTokenSource.
In this case, cancellationRequestedByUser is true, but _cancellationTokenSource is null since the dispose method in ProgressDialog sets it to null. I think the obvious solution here is to just to a null safe call on Cancel, especially since in line 852 it's already doing it.
There's some sort of race condition where if you press the cancel button on the progress dialog and then dispose it, a null reference exception will occur in _backgroundWorker_ProgressChanged where it tries to cancel the field, _cancellationTokenSource.
https://github.com/ookii-dialogs/ookii-dialogs-wpf/blob/9addd3ff1d35e1a006b8bea0ac8d98462924e2a5/src/Ookii.Dialogs.Wpf/ProgressDialog.cs#L849-L857
In this case, cancellationRequestedByUser is true, but _cancellationTokenSource is null since the dispose method in ProgressDialog sets it to null. I think the obvious solution here is to just to a null safe call on Cancel, especially since in line 852 it's already doing it.