Skip to content

Catch null products #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2021
Merged

Catch null products #39

merged 2 commits into from
Sep 9, 2021

Conversation

niallzato
Copy link
Contributor

If products are passed as a null value it will cause a fatal exception in app. For example:
Analytics.with(this).track("Cart Viewed", new Properties()
.putValue("products", null));

Will throw the following exception:

2021-09-01 14:57:49.425 19542-19542/com.example.firebase E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.firebase, PID: 19542
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at com.segment.analytics.android.integrations.firebase.FirebaseIntegration.formatProducts(FirebaseIntegration.java:227)

@niallzato niallzato merged commit 476407e into master Sep 9, 2021
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.

2 participants