Avoid errors if src changes before first render & img is not there

This commit is contained in:
nathan 2022-05-27 14:20:35 -06:00
parent c212734618
commit 57e1845c16

View File

@ -172,7 +172,7 @@ export class Et2Image extends Et2Widget(SlotMixin(LitElement)) implements et2_ID
{ {
super.updated(changedProperties); super.updated(changedProperties);
if(changedProperties.has("src")) if(changedProperties.has("src") && this._img)
{ {
this._img.setAttribute("src", this.parse_href(this.src) || this.parse_href(this.default_src)); this._img.setAttribute("src", this.parse_href(this.src) || this.parse_href(this.default_src));
} }