firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

fix(fcm): Fix error throw when data property exists but is undefined

Open italoiz opened this issue 5 years ago • 3 comments

When use messaging().sendToDevice(tokens, payload) where payload contains the data property, but it's contains undefined value, I given throws the follow error:

TypeError: Cannot use 'in' operator to search for 'from' in undefined

The following Pull Request contains the solution of the issue with the covered unit tests.

italoiz avatar Jan 20 '21 09:01 italoiz

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] avatar Jan 20 '21 09:01 google-cla[bot]

@googlebot I signed it!

italoiz avatar Jan 20 '21 10:01 italoiz

This has recently happened to me.

aprilmintacpineda avatar May 27 '21 15:05 aprilmintacpineda

Hey @hiranya911, Is this PR still need a fix?

italoiz avatar Mar 21 '23 14:03 italoiz