mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Merge pull request #16 from vector-im/bwindels/dontcrashoninvalidimg
Don't crash on m.image without url
This commit is contained in:
commit
4f5609f7c1
@ -27,13 +27,19 @@ export class ImageTile extends MessageTile {
|
||||
|
||||
get thumbnailUrl() {
|
||||
const mxcUrl = this._getContent().url;
|
||||
if (mxcUrl) {
|
||||
return this._room.mxcUrlThumbnail(mxcUrl, this.thumbnailWidth, this.thumbnailHeight, "scale");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
get url() {
|
||||
const mxcUrl = this._getContent().url;
|
||||
if (mxcUrl) {
|
||||
return this._room.mxcUrl(mxcUrl);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
_scaleFactor() {
|
||||
const {info} = this._getContent();
|
||||
|
Loading…
Reference in New Issue
Block a user