Skip to content

Commit

Permalink
fix: crash when opening null url (#2134)
Browse files Browse the repository at this point in the history
* fix: crash when opening null url

* fix: only check url if type is video
previous if would fail the validation for non-video attachments

---------

Co-authored-by: Arthur Geron <[email protected]>
  • Loading branch information
arthurgeron-work and Arthur Geron authored Oct 31, 2023
1 parent c884bf2 commit 660c19d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package/src/components/Attachment/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ const GalleryThumbnail = <
};

const defaultOnPress = () => {
if ((thumbnail.type === 'video' && !thumbnail.thumb_url) || !thumbnail.url) {
return;
}
if (thumbnail.type === 'video' && !isVideoPackageAvailable()) {
// This condition is kinda unreachable, since we render videos as file attachment if the video
// library is not installed. But doesn't hurt to have extra safeguard, in case of some customizations.
Expand Down

0 comments on commit 660c19d

Please sign in to comment.