Fix for undefined stateObj in media player row (#8114)

This commit is contained in:
Bram Kragten 2021-01-08 16:39:55 +01:00 committed by GitHub
parent 2b0f43f334
commit 0d281f8437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,7 +82,6 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
}
const stateObj = this.hass.states[this._config.entity] as MediaPlayerEntity;
const state = stateObj.state;
if (!stateObj) {
return html`
@ -92,6 +91,8 @@ class HuiMediaPlayerEntityRow extends LitElement implements LovelaceRow {
`;
}
const state = stateObj.state;
const buttons = html`
${!this._narrow &&
state === "playing" &&