Make error optional in connection lost service check (#8937)

This commit is contained in:
J. Nick Koston
2021-04-20 10:58:39 +02:00
committed by GitHub
parent e3c38b93f4
commit f21ed24a49
2 changed files with 2 additions and 2 deletions
@@ -282,7 +282,7 @@ class HaPanelDevService extends LitElement {
} catch (err) {
const [domain, service] = this._serviceData.service.split(".", 2);
if (
err.error.code === ERR_CONNECTION_LOST &&
err.error?.code === ERR_CONNECTION_LOST &&
serviceCallWillDisconnect(domain, service)
) {
return;
+1 -1
View File
@@ -81,7 +81,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
)) as Promise<ServiceCallResponse>;
} catch (err) {
if (
err.error.code === ERR_CONNECTION_LOST &&
err.error?.code === ERR_CONNECTION_LOST &&
serviceCallWillDisconnect(domain, service)
) {
throw err;