Commit afb6484
committed
fix: resolve ephemeralMessage crash on iOS audio messages in getBase64FromMediaMessage
When processing iOS audio messages in getBase64FromMediaMessage, the subtype unwrapping loop assumed msg.message[subtype].message always exists if msg.message[subtype] is truthy. iOS ephemeral messages can have ephemeralMessage without the standard .message property, causing 'Cannot read properties of undefined' crashes.
- Add guard for msg.message being falsy before the loop
- Use optional chaining (msg.message[subtype]?.message) in the loop condition
Closes #25501 parent 7a55a2b commit afb6484
1 file changed
Lines changed: 5 additions & 1 deletion
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4400 | 4400 | | |
4401 | 4401 | | |
4402 | 4402 | | |
| 4403 | + | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
4403 | 4407 | | |
4404 | | - | |
| 4408 | + | |
4405 | 4409 | | |
4406 | 4410 | | |
4407 | 4411 | | |
| |||
0 commit comments