From 8950ccace780f43d7831b0b577611e95d05d5df9 Mon Sep 17 00:00:00 2001 From: Heiko Rothe Date: Sat, 1 Feb 2020 22:58:18 +0100 Subject: [PATCH] fix(home-assistant): only end connection if connected If the connection could not be established during boot mqttClient would not have been set - and calling end would throw an error. --- src/integrations/home-assistant/home-assistant.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/home-assistant/home-assistant.service.ts b/src/integrations/home-assistant/home-assistant.service.ts index e6f42b5..333718a 100644 --- a/src/integrations/home-assistant/home-assistant.service.ts +++ b/src/integrations/home-assistant/home-assistant.service.ts @@ -87,7 +87,7 @@ export class HomeAssistantService ); } }); - return this.mqttClient.end(); + return this.mqttClient?.end(); } /**