Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit eed6ea7

Browse files
committed
Fix image size failures
1 parent c06766c commit eed6ea7

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/screens/DirectMessagesScreen.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,13 @@ const CustomMessageImage = React.memo(
447447
Image.getSize(image, (width, height) => {
448448
const aspectRatio = width / height;
449449
const largerDimension = width > height ? 'width' : 'height';
450-
setDimensions({
451-
[largerDimension]: 'auto',
452-
aspectRatio,
453-
});
450+
451+
if (isFinite(aspectRatio)) {
452+
setDimensions({
453+
[largerDimension]: 'auto',
454+
aspectRatio,
455+
});
456+
}
454457
});
455458
}
456459
}, [props.currentMessage?.image]);

0 commit comments

Comments
 (0)