ToothlessGear / node-gcm

A NodeJS wrapper library port to send data to Android devices via Google Cloud Messaging
https://github.com/ToothlessGear/node-gcm
Other
1.3k stars 206 forks source link

Warn when sending a message with data.from in its payload #270

Closed eladnava closed 7 years ago

eladnava commented 8 years ago

As per #254.

hypesystem commented 8 years ago

Are we sure that message.params.data is always set/an object?

eladnava commented 8 years ago

I think you are right -- if someone was to send a GCM notification with just the notification object and no data object (that seems to be valid according to the docs), then data might be null.

Updated the PR to check for params.data beforehand. Nice catch! 👍