Skip to content

Commit

Permalink
Merge pull request #40351 from Krishna2323/fix/pr-bug/40162
Browse files Browse the repository at this point in the history
fix: wrong attachment corrupt alert for pdf.
  • Loading branch information
arosiclair authored Apr 18, 2024
2 parents 9b839f4 + 484344f commit 9500169
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/AttachmentPicker/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ function AttachmentPicker({type = CONST.ATTACHMENT_PICKER_TYPE.FILE, children, s
const validateAndCompleteAttachmentSelection = useCallback(
(fileData: FileResponse) => {
// Check if the file dimensions indicate corruption
// The width/height for corrupt file is -1 on android native and 0 on ios native
if (!fileData.width || !fileData.height || (fileData.width <= 0 && fileData.height <= 0)) {
// The width/height for a corrupted file is -1 on android native and 0 on ios native
// We must check only numeric values because the width/height can be undefined for non-image files
if ((typeof fileData.width === 'number' && fileData.width <= 0) || (typeof fileData.height === 'number' && fileData.height <= 0)) {
showImageCorruptionAlert();
return Promise.resolve();
}
Expand Down

0 comments on commit 9500169

Please sign in to comment.