Skip to content

fix: guard against undefined media in downloadMedia with helpful error messages#2737

Open
wiliyam wants to merge 1 commit intowppconnect-team:masterfrom
wiliyam:fix/download-media-undefined-msg-chunks-2736
Open

fix: guard against undefined media in downloadMedia with helpful error messages#2737
wiliyam wants to merge 1 commit intowppconnect-team:masterfrom
wiliyam:fix/download-media-undefined-msg-chunks-2736

Conversation

@wiliyam
Copy link
Copy Markdown

@wiliyam wiliyam commented Apr 2, 2026

Summary

Fixes #2736

Problem

Calling downloadMedia with a message id from quotedMsgObj when the object is null/undefined caused an unhandled crash deep inside WPP: Cannot read properties of undefined (reading 'msgChunks').

Fix

  • Guard against falsy messageId with a clear error message explaining the cause
  • Guard against null media blob returned by WPP.chat.downloadMedia with a descriptive error
  • Both errors now include actionable context for the developer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

downloadMedia - returning error "Error: Cannot read properties of undefined (reading 'msgChunks')"

1 participant