From 51bfd520957cf9e24132ac010524c6d1cb4b14c9 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Sat, 10 Apr 2021 01:02:20 +0200 Subject: [PATCH] newer c# lang --- ConnectorDataMqtt/Mqtt.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ConnectorDataMqtt/Mqtt.cs b/ConnectorDataMqtt/Mqtt.cs index 6647309..4e2beb8 100644 --- a/ConnectorDataMqtt/Mqtt.cs +++ b/ConnectorDataMqtt/Mqtt.cs @@ -123,14 +123,14 @@ namespace BlubbFish.Utils.IoT.Connector.Data { #region IDisposable Support private Boolean disposedValue = false; - public override Boolean IsConnected => this.client != null ? this.client.IsConnected : false; + public override Boolean IsConnected => this.client != null && this.client.IsConnected; protected virtual void Dispose(Boolean disposing) { if(!this.disposedValue) { if(disposing) { try { this.connectionWatcherRunning = false; - while(this.connectionWatcher.IsAlive) { + while(this.connectionWatcher != null && this.connectionWatcher.IsAlive) { Thread.Sleep(10); } this.connectionWatcher = null;