Merge branch 'soru/fix-empty-info' into 'main'
fix: Images with an info block but no size crashing See merge request ChristianPauly/fluffychat-flutter!160
This commit is contained in:
commit
e3e8f2517e
|
@ -43,9 +43,11 @@ extension LocalizedBody on Event {
|
||||||
[MessageTypes.Image, MessageTypes.Sticker].contains(messageType) &&
|
[MessageTypes.Image, MessageTypes.Sticker].contains(messageType) &&
|
||||||
(kIsWeb ||
|
(kIsWeb ||
|
||||||
(content['info'] is Map &&
|
(content['info'] is Map &&
|
||||||
|
content['info']['size'] is int &&
|
||||||
content['info']['size'] < room.client.database.maxFileSize) ||
|
content['info']['size'] < room.client.database.maxFileSize) ||
|
||||||
(hasThumbnail &&
|
(hasThumbnail &&
|
||||||
content['info']['thumbnail_info'] is Map &&
|
content['info']['thumbnail_info'] is Map &&
|
||||||
|
content['info']['thumbnail_info']['size'] is int &&
|
||||||
content['info']['thumbnail_info']['size'] <
|
content['info']['thumbnail_info']['size'] <
|
||||||
room.client.database.maxFileSize) ||
|
room.client.database.maxFileSize) ||
|
||||||
(content['url'] is String));
|
(content['url'] is String));
|
||||||
|
|
Loading…
Reference in a new issue