mattermost-mobile-upstream/app/utils/file
Mattermost Build d9df0cdf3e
[MM-69129] Prevent crash on nameless attachment (#10091) (#10134)
* [MM-69129] Prevent crash on nameless attachment.

A draft attachment persisted without a name or an extension made
`isImage` call `extractExtension(undefined)`, throwing on every render of
the channel and of the global Drafts screen. Guard against it so the
draft renders as a plain file card that the user can remove.

* [MM-69129] Exercise the upload item tests against the real file utils

Both suites stubbed `isImage` and `getFormattedFileSize`, which are pure
functions, so they asserted states the component can never see and could
not have caught this crash. Drop the mocks and let each fixture decide
which branch renders.

(cherry picked from commit 876af76f36)

Co-authored-by: Jesse Hallam <jesse@thehallams.ca>
2026-09-07 08:26:41 +03:00
..
file_picker Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
index.test.ts [MM-69129] Prevent crash on nameless attachment (#10091) (#10134) 2026-09-07 08:26:41 +03:00
index.ts [MM-69129] Prevent crash on nameless attachment (#10091) (#10134) 2026-09-07 08:26:41 +03:00