diff --git a/DnsServerCore/LogManager.cs b/DnsServerCore/LogManager.cs index 04d4ff02..2c9c2755 100644 --- a/DnsServerCore/LogManager.cs +++ b/DnsServerCore/LogManager.cs @@ -247,7 +247,8 @@ namespace DnsServerCore { try { - _queueCancellationTokenSource.Cancel(); + if (_logOut != null) + _queueCancellationTokenSource.Cancel(); lock (_logFileLock) { @@ -560,7 +561,8 @@ namespace DnsServerCore { try { - _queueCancellationTokenSource.Cancel(); + if (_logOut != null) + _queueCancellationTokenSource.Cancel(); lock (_logFileLock) {