Handle crash on new item page when SWF asset has no image available
This commit is contained in:
parent
052c02f841
commit
c9f2d660bc
2 changed files with 4 additions and 4 deletions
|
@ -112,9 +112,7 @@ class OutfitLayer extends HTMLElement {
|
||||||
this.#setStatus("error"),
|
this.#setStatus("error"),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
console.warn(`<outfit-layer> contained no image or iframe: `, this);
|
||||||
`<outfit-layer> must contain an <img> or <iframe> tag`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,5 +20,7 @@
|
||||||
}
|
}
|
||||||
- if swf_asset.canvas_movie?
|
- if swf_asset.canvas_movie?
|
||||||
%iframe{src: swf_asset_path(swf_asset, playing: outfit_viewer_is_playing ? true : nil)}
|
%iframe{src: swf_asset_path(swf_asset, playing: outfit_viewer_is_playing ? true : nil)}
|
||||||
- else
|
- elsif swf_asset.image_url.present?
|
||||||
= image_tag swf_asset.image_url, alt: ""
|
= image_tag swf_asset.image_url, alt: ""
|
||||||
|
- else
|
||||||
|
/ No movie or image available for SWF asset: #{swf_asset.url}
|
Loading…
Reference in a new issue