diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index 347c096b..3236d31e 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -933,10 +933,17 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable if (this.cancellationTokenSource is not null) { - if(!this.cancellationTokenSource.IsCancellationRequested) - await this.cancellationTokenSource.CancelAsync(); + try + { + if(!this.cancellationTokenSource.IsCancellationRequested) + await this.cancellationTokenSource.CancelAsync(); - this.cancellationTokenSource.Dispose(); + this.cancellationTokenSource.Dispose(); + } + catch + { + // ignored + } } }