[Firebase Mobile] OnDestroy bug ("Cannot set property 'destroyed' of null") in browser preview
Forge component by David Sousa
Application Type

Hi! I am currently using the in-development version of the component (v1.0.10) because the FirebaseCloudMessaging callbacks felt more reliable on that one.

There's one really small issue when running it in a browser preview. Because the OnDestroy event tries to set a sub-attribute of a local object called "instance", which isn't instantiated when the plugin is unavailable (e.g. running in browser preview), we end up getting a null reference exception error.

Fixing this should be as simple as wrapping this in a if that actually checks if the instance actually has something to it:

Could you consider merging this into the main component?



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.