Skip to content

Commit f55d059

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a47ebb1 commit f55d059

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/libs/validateAttachmentFile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ async function validateAttachmentFile(file: FileObject, item?: DataTransferItem,
7676
// The backing file was already modified or deleted since it was picked.
7777
return {isValid: false, error: CONST.FILE_VALIDATION_ERRORS.FILE_INVALID};
7878
}
79-
// Read the superseded URI from normalizedFile: updatedFile is always a fresh File that
80-
// doesn't carry the custom .uri property.
79+
// Read the superseded URI from normalizedFile: snapshotPickedFile may return a fresh File that
80+
// doesn't carry the custom .uri property, so updatedFile.uri is not reliable for the previous URL.
8181
const previousUri = normalizedFile.uri;
8282
const inputSource = URL.createObjectURL(updatedFile);
8383
if (previousUri && previousUri !== inputSource && previousUri.startsWith('blob:')) {

0 commit comments

Comments
 (0)