-
Notifications
You must be signed in to change notification settings - Fork 365
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
trackEvent does not handle null values in JSONObject #505
Comments
@markcerqueira Hey, sorry for the delay!! If I understand it correctly, what you want is to skip the properties with |
@yinfeiru Yep! The current behavior throws an Exception and the entire event is not logged. Unsure if the best behavior is to skip the property altogether or place in a blank String. I'll defer to you all on that call. Thanks and cheers! 😄 |
@markcerqueira To me, I feel like skipping the property is the way to go because on Mixpanel you can easily filter out the skipped properties (or the Cheers! |
@markcerqueira Hey, sorry for the late. The fix will be available in the next release. PR is here. |
@yinfeiru Awesome! Thank you! |
This has been fixed in the latest release 👍 |
If I call
trackEvent
inMixPanelAPI
with a JSONObject containing a null value the method throws an exception. This is caught internally but the result is that the event is not logged to MixPanel.Line in question is here.
properties.get(key)
will throw aJSONException
if the value is null. The caller to this method could validate input but it seems preferable to handle the nulls and track the event instead of swallowing the exception and not logging the event.Oddly enough, I can only make it throw an exception on devices running Android 4.3 (I used a HTC One). Anything higher than that works, which is perplexing but maybe something changed in implementations somewhere along the way.
Thank you!
The text was updated successfully, but these errors were encountered: