Skip to content

Commit 7d7e82a

Browse files
committed
Update function with bug fix.
1 parent 8c0286d commit 7d7e82a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

analytics/src/analytics_android.cc

+3-6
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,12 @@ jobject StringVariantMapToBundle(JNIEnv* env,
530530
// Bundle keys must be strings.
531531
const char* key = pair.first.c_str();
532532
const Variant& value = pair.second;
533-
// A null variant clears the default parameter. The Android SDK uses a null
534-
// value in the Bundle for this.
535-
if (value.is_null()) {
536-
// Add null string to clear the parameter.
537-
AddToBundle(env, bundle, key, static_cast<const char*>(nullptr));
538-
} else if (!AddVariantToBundle(env, bundle, key, value)) {
533+
// AddVariantToBundle handles all Variant types, including null.
534+
if (!AddVariantToBundle(env, bundle, key, value)) {
539535
LogError("SetDefaultEventParameters: Unsupported type (%s) for key %s.",
540536
Variant::TypeName(value.type()), key);
541537
}
538+
// CheckAndClearJniExceptions is called within AddVariantToBundle.
542539
}
543540
return bundle;
544541
}

0 commit comments

Comments
 (0)