Skip to content

Commit

Permalink
Merge pull request #40471 from Krishna2323/krishna2323/follow-up/37435
Browse files Browse the repository at this point in the history
fix: Submit Expense - Error message about corrupted file when dragging and dropping image receipt
(cherry picked from commit 8699315)
  • Loading branch information
thienlnam authored and OSBotify committed Apr 19, 2024
1 parent d0766c4 commit 73ea3bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/fileDownload/FileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function base64ToFile(base64: string, filename: string): File {
}

function validateImageForCorruption(file: FileObject): Promise<void> {
if (!Str.isImage(file.name ?? '')) {
if (!Str.isImage(file.name ?? '') || !file.uri) {
return Promise.resolve();
}
return new Promise((resolve, reject) => {
Expand Down
1 change: 1 addition & 0 deletions src/pages/iou/request/step/IOURequestStepScan/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ function IOURequestStepScan({
onDrop={(e) => {
const file = e?.dataTransfer?.files[0];
if (file) {
file.uri = URL.createObjectURL(file);
setReceiptAndNavigate(file);
}
}}
Expand Down

0 comments on commit 73ea3bd

Please sign in to comment.