Ensure blurhash is treated as optional

Fixes https://github.com/vector-im/element-web/issues/18702
This commit is contained in:
Travis Ralston 2021-08-23 16:48:39 -06:00
parent 32343f3382
commit 30c9860274
2 changed files with 3 additions and 3 deletions

View file

@ -43,7 +43,7 @@ export default class MStickerBody extends MImageBody {
// Placeholder to show in place of the sticker image if
// img onLoad hasn't fired yet.
protected getPlaceholder(width: number, height: number): JSX.Element {
if (this.props.mxEvent.getContent().info[BLURHASH_FIELD]) return super.getPlaceholder(width, height);
if (this.props.mxEvent.getContent().info?.[BLURHASH_FIELD]) return super.getPlaceholder(width, height);
return <img src={require("../../../../res/img/icons-show-stickers.svg")} width="75" height="75" />;
}