Skip to content

Commit

Permalink
fix(home-assistant): only end connection if connected
Browse files Browse the repository at this point in the history
If the connection could not be established during boot mqttClient would
not have been set - and calling end would throw an error.
  • Loading branch information
mKeRix committed Feb 1, 2020
1 parent c208d83 commit 8950cca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/integrations/home-assistant/home-assistant.service.ts
Expand Up @@ -87,7 +87,7 @@ export class HomeAssistantService
);
}
});
return this.mqttClient.end();
return this.mqttClient?.end();
}

/**
Expand Down

0 comments on commit 8950cca

Please sign in to comment.