Fix resize observer on error card (#5158)
* Fix resize observer on error card * Update hui-media-control-card.ts
This commit is contained in:
@@ -521,7 +521,12 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {
|
||||
debounce(() => this._measureCard(), 250, false)
|
||||
);
|
||||
|
||||
this._resizeObserver.observe(this.shadowRoot!.querySelector("ha-card")!);
|
||||
const card = this.shadowRoot!.querySelector("ha-card");
|
||||
// If we show an error or warning there is no ha-card
|
||||
if (!card) {
|
||||
return;
|
||||
}
|
||||
this._resizeObserver.observe(card);
|
||||
}
|
||||
|
||||
private _handleMoreInfo(): void {
|
||||
|
||||
Reference in New Issue
Block a user