fix: Fix crash when stopping in case MQTT client did not connect yet (#22110)

This commit is contained in:
Koen Kanters authored and GitHub committed 2024-04-06 10:49:22 +00:00
1 parent 002050f35b
commit 92f53235f3
1 file changed
+1 -1
+1 -1
View File
@@ -127,7 +127,7 @@ export default class MQTT {
{retain: true, qos: 0});
this.eventBus.removeListeners(this);
logger.info('Disconnecting from MQTT server');
this.client.end();
this.client?.end();
}
subscribe(topic: string): void {