Skip to content

Commit d65876f

Browse files
committed
Fixes #163 - Add additional null check for breadcrumb data
1 parent beb6cad commit d65876f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

android/src/main/java/io/sentry/RNSentryModule.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,12 @@ public void captureBreadcrumb(ReadableMap breadcrumb) {
166166
if (breadcrumb.hasKey("category")) {
167167
breadcrumbBuilder.setCategory(breadcrumb.getString("category"));
168168
}
169-
if (breadcrumb.hasKey("data")) {
169+
if (breadcrumb.hasKey("data") && breadcrumb.getMap("data") != null) {
170170
Map<String, String> newData = new HashMap<>();
171171
for (Map.Entry<String, Object> data : breadcrumb.getMap("data").toHashMap().entrySet()) {
172-
newData.put(data.getKey(), data.getValue().toString());
172+
if (data.getValue() != null) {
173+
newData.put(data.getKey(), data.getValue().toString());
174+
}
173175
}
174176
breadcrumbBuilder.setData(newData);
175177
}

0 commit comments

Comments
 (0)