Skip to content

Catch null products#39

Merged
niallzato merged 2 commits intomasterfrom
niall/catch_null
Sep 9, 2021
Merged

Catch null products#39
niallzato merged 2 commits intomasterfrom
niall/catch_null

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