From 2a13eb700abb02054c86845df8f0f20c371b77dd Mon Sep 17 00:00:00 2001 From: Alec Winograd Date: Wed, 14 Feb 2018 09:02:27 +0100 Subject: [PATCH] fix: Fix null object exception with tags (#351) Fixes https://github.com/getsentry/react-native-sentry/issues/325 --- android/src/main/java/io/sentry/RNSentryModule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/io/sentry/RNSentryModule.java b/android/src/main/java/io/sentry/RNSentryModule.java index df124ee805..2aa66489cf 100644 --- a/android/src/main/java/io/sentry/RNSentryModule.java +++ b/android/src/main/java/io/sentry/RNSentryModule.java @@ -241,7 +241,8 @@ public void captureEvent(ReadableMap event) { if (castEvent.hasKey("tags")) { for (Map.Entry entry : castEvent.getMap("tags").toHashMap().entrySet()) { - eventBuilder.withTag(entry.getKey(), entry.getValue().toString()); + String tagValue = entry.getValue() != null ? entry.getValue().toString() : "INVALID_TAG"; + eventBuilder.withTag(entry.getKey(), tagValue); } }