forked from mystiq/hydrogen-web
dont crash on m.image without url
This commit is contained in:
parent
989a27395e
commit
70e6515b5c
1 changed files with 8 additions and 2 deletions
|
@ -27,13 +27,19 @@ export class ImageTile extends MessageTile {
|
||||||
|
|
||||||
get thumbnailUrl() {
|
get thumbnailUrl() {
|
||||||
const mxcUrl = this._getContent().url;
|
const mxcUrl = this._getContent().url;
|
||||||
|
if (mxcUrl) {
|
||||||
return this._room.mxcUrlThumbnail(mxcUrl, this.thumbnailWidth, this.thumbnailHeight, "scale");
|
return this._room.mxcUrlThumbnail(mxcUrl, this.thumbnailWidth, this.thumbnailHeight, "scale");
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
get url() {
|
get url() {
|
||||||
const mxcUrl = this._getContent().url;
|
const mxcUrl = this._getContent().url;
|
||||||
|
if (mxcUrl) {
|
||||||
return this._room.mxcUrl(mxcUrl);
|
return this._room.mxcUrl(mxcUrl);
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
_scaleFactor() {
|
_scaleFactor() {
|
||||||
const {info} = this._getContent();
|
const {info} = this._getContent();
|
||||||
|
|
Loading…
Reference in a new issue