Skip to content

Commit 5939b02

Browse files
committed
chore: allow nulls
1 parent 019d52e commit 5939b02

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/kotlin/spp/protocol/instrument/variable/LiveVariableControl.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ data class LiveVariableControl(
3434
maxObjectDepth = json.getInteger("maxObjectDepth"),
3535
maxObjectSize = json.getInteger("maxObjectSize"),
3636
maxCollectionLength = json.getInteger("maxCollectionLength"),
37-
variableTypeConfig = json.getJsonObject("variableTypeConfig")
38-
.associate { it.key to LiveVariableControl(it.value as JsonObject) },
39-
variableNameConfig = json.getJsonObject("variableNameConfig")
40-
.associate { it.key to LiveVariableControl(it.value as JsonObject) }
37+
variableTypeConfig = json.getJsonObject("variableTypeConfig")?.let {
38+
it.associate { it.key to LiveVariableControl(it.value as JsonObject) }
39+
}.orEmpty(),
40+
variableNameConfig = json.getJsonObject("variableNameConfig")?.let {
41+
it.associate { it.key to LiveVariableControl(it.value as JsonObject) }
42+
}.orEmpty()
4143
)
4244

4345
fun toJson(): JsonObject {

0 commit comments

Comments
 (0)