Skip to content

Commit 4cfe0d4

Browse files
Merge pull request #73 from Couchbase-Ecosystem/fix/null-issue-fix
refactor: simplify array handling and improve blob data validation in DataAdapter, Fixed #72
2 parents dfdf798 + c5e3897 commit 4cfe0d4

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

android/src/main/java/com/cblreactnative/DataAdapter.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,19 @@ object DataAdapter {
123123
indexProperties?.let { ip ->
124124
if (indexType == "value") {
125125
for (countValue in 0 until ip.size()) {
126-
val arItems = ip.getArray(countValue)
127-
arItems?.let { items ->
126+
ip.getArray(countValue)?.let { items ->
128127
for (countArray in 0 until items.size()) {
129-
val item = items.getString(countArray)
130-
item?.let { itemValue ->
128+
items.getString(countArray)?.let { itemValue ->
131129
valueIndexProperties.add(ValueIndexItem.property(itemValue))
132130
}
133131
}
134132
}
135133
}
136134
} else {
137135
for (countValue in 0 until ip.size()) {
138-
val arItems = ip.getArray(countValue)
139-
arItems?.let { items ->
136+
ip.getArray(countValue)?.let { items ->
140137
for (countArray in 0 until items.size()) {
141-
val item = items.getString(countArray)
142-
item?.let { itemValue ->
138+
items.getString(countArray)?.let { itemValue ->
143139
fullTextIndexProperties.add(FullTextIndexItem.property(itemValue))
144140
}
145141
}

0 commit comments

Comments
 (0)