diff --git a/src/sentry/wrapper.android.ts b/src/sentry/wrapper.android.ts index fc405fe..a5ea843 100644 --- a/src/sentry/wrapper.android.ts +++ b/src/sentry/wrapper.android.ts @@ -869,7 +869,11 @@ export namespace NATIVE { return; } runOnScope((scope) => { - scope.setTag(key, value); + if (value){ + scope.setTag(key, value); + } else { + scope.removeTag(key); + } }); } @@ -878,7 +882,11 @@ export namespace NATIVE { return; } runOnScope((scope) => { - scope.setExtra(key, extra); + if (extra) { + scope.setExtra(key, extra); + } else { + scope.removeExtra(key); + } }); } diff --git a/src/sentry/wrapper.ios.ts b/src/sentry/wrapper.ios.ts index 40e4f68..93b7981 100644 --- a/src/sentry/wrapper.ios.ts +++ b/src/sentry/wrapper.ios.ts @@ -536,7 +536,11 @@ export namespace NATIVE { return; } NSSentrySDK.configureScope((scope: SentryScope) => { - scope.setTagValueForKey(value, key); + if (value){ + scope.setTagValueForKey(key, value); + } else { + scope.removeTagForKey(key); + } }); } @@ -545,7 +549,11 @@ export namespace NATIVE { return; } NSSentrySDK.configureScope((scope: SentryScope) => { - scope.setExtraValueForKey(extra, key); + if (extra) { + scope.setExtraValueForKey(key, extra); + } else { + scope.removeContextForKey(key); + } }); }