Skip to content

fix(firestore): add exists check to prevent crash on undefined docume…#63

Open
vibhutomer wants to merge 1 commit into
seetadev:mainfrom
vibhutomer:fix/download-error-handling
Open

fix(firestore): add exists check to prevent crash on undefined docume…#63
vibhutomer wants to merge 1 commit into
seetadev:mainfrom
vibhutomer:fix/download-error-handling

Conversation

@vibhutomer
Copy link
Copy Markdown

🔗 Related Issue

Description of Changes

  • Added a !docSnapshot.exists() validation check inside the getFile helper within downloadFileFromFirebase.
  • If the document is missing, it now safely throws an explicit error instead of trying to manipulate an undefined object.

Impact

  • Crash Prevention: Prevents a fatal TypeError: Cannot read properties of undefined when a file is out of sync or missing.
  • Graceful Failure: The error is now safely caught by the parent catch block, allowing the application to continue running smoothly.

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.

Unhandled Missing Document in Cloud Downloads

1 participant