dont crash on m.image without url

This commit is contained in:
Bruno Windels 2020-08-17 10:29:29 +02:00
parent 989a27395e
commit 70e6515b5c

View file

@ -27,12 +27,18 @@ export class ImageTile extends MessageTile {
get thumbnailUrl() {
const mxcUrl = this._getContent().url;
return this._room.mxcUrlThumbnail(mxcUrl, this.thumbnailWidth, this.thumbnailHeight, "scale");
if (mxcUrl) {
return this._room.mxcUrlThumbnail(mxcUrl, this.thumbnailWidth, this.thumbnailHeight, "scale");
}
return null;
}
get url() {
const mxcUrl = this._getContent().url;
return this._room.mxcUrl(mxcUrl);
if (mxcUrl) {
return this._room.mxcUrl(mxcUrl);
}
return null;
}
_scaleFactor() {