Skip to content

Commit 781b137

Browse files
committed
Handle optional String on removeAttributes
1 parent 5eb9d35 commit 781b137

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/core/android/src/main/kotlin/com/datadog/reactnative/DdSdkImplementation.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ class DdSdkImplementation(
115115
fun removeAttributes(keys: ReadableArray, promise: Promise) {
116116
val keysArray = mutableListOf<String>()
117117
for (i in 0 until keys.size()) {
118-
val key: String = keys.getString(i)
119-
keysArray.add(key)
118+
keys.getString(i)?.let { if (it.isNotBlank()) keysArray.add(it) }
120119
}
121120
val keysStringArray = keysArray.toTypedArray()
122121

0 commit comments

Comments
 (0)