Skip to content

Commit

Permalink
Guard against empty application credential domain (home-assistant#17786)
Browse files Browse the repository at this point in the history
  • Loading branch information
silamon committed Sep 4, 2023
1 parent 77c08fd commit 5bb8c51
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ export class DialogAddApplicationCredential extends LitElement {
name: domainToName(this.hass.localize, domain),
}));
await this.hass.loadBackendTranslation("application_credentials");
if (this._domain) {
this._updateDescription();
}
this._updateDescription();
}

protected render() {
Expand Down Expand Up @@ -265,11 +263,15 @@ export class DialogAddApplicationCredential extends LitElement {
}

private async _updateDescription() {
if (!this._domain) {
return;
}

await this.hass.loadBackendTranslation(
"application_credentials",
this._domain
);
const info = this._config!.integrations[this._domain!];
const info = this._config!.integrations[this._domain];
this._description = this.hass.localize(
`component.${this._domain}.application_credentials.description`,
info.description_placeholders
Expand Down

0 comments on commit 5bb8c51

Please sign in to comment.