Only disconnect if pipe not already disposed

Former-commit-id: 01b1dd228e
This commit is contained in:
Malte Rosenbjerg 2020-12-06 01:06:31 +01:00
parent 2c1831587f
commit 4d6db5a9b5

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)
{