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

This commit is contained in:
J. Nick Koston 2021-04-19 22:58:39 -10:00 committed by GitHub
parent e3c38b93f4
commit f21ed24a49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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;

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;