Only disconnect if pipe not already disposed

This commit is contained in:
Malte Rosenbjerg 2020-12-06 01:06:31 +01:00
parent 56608e600e
commit 01b1dd228e

View file

@ -42,7 +42,7 @@ public async Task During(CancellationToken cancellationToken = default)
{
await ProcessDataAsync(cancellationToken);
Debug.WriteLine($"Disconnecting NamedPipeServerStream on {GetType().Name}");
Pipe.Disconnect();
Pipe?.Disconnect();
}
catch (TaskCanceledException)
{