diff --git a/src/panels/lovelace/components/hui-image.ts b/src/panels/lovelace/components/hui-image.ts index cdc7b06aa1..04a12f34d8 100644 --- a/src/panels/lovelace/components/hui-image.ts +++ b/src/panels/lovelace/components/hui-image.ts @@ -167,15 +167,14 @@ class HuiImage extends LitElement { if (!this.hass || !this.cameraImage) { return; } - if (this._cameraImageSrc) { - URL.revokeObjectURL(this._cameraImageSrc); - this._cameraImageSrc = undefined; - } try { const { content_type: contentType, content } = await fetchThumbnail( this.hass, this.cameraImage ); + if (this._cameraImageSrc) { + URL.revokeObjectURL(this._cameraImageSrc); + } this._cameraImageSrc = URL.createObjectURL( b64toBlob(content, contentType) );