Skip to content

Commit 84bfa23

Browse files
committed
chore: optional deser
1 parent bb271ea commit 84bfa23

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/kotlin/spp/protocol/instrument/LiveBreakpoint.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ data class LiveBreakpoint(
5959
applyImmediately = json.getBoolean("applyImmediately") ?: false,
6060
applied = json.getBoolean("applied") ?: false,
6161
pending = json.getBoolean("pending") ?: false,
62-
throttle = InstrumentThrottle(json.getJsonObject("throttle")),
63-
meta = json.getJsonObject("meta").associate { it.key to it.value }
62+
throttle = json.getJsonObject("throttle")?.let { InstrumentThrottle(it) } ?: InstrumentThrottle.DEFAULT,
63+
meta = json.getJsonObject("meta")?.associate { it.key to it.value } ?: emptyMap()
6464
)
6565

6666
override fun toJson(): JsonObject {

src/main/kotlin/spp/protocol/instrument/LiveLog.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ data class LiveLog(
5656
applyImmediately = json.getBoolean("applyImmediately") ?: false,
5757
applied = json.getBoolean("applied") ?: false,
5858
pending = json.getBoolean("pending") ?: false,
59-
throttle = InstrumentThrottle(json.getJsonObject("throttle")),
60-
meta = json.getJsonObject("meta").associate { it.key to it.value }
59+
throttle = json.getJsonObject("throttle")?.let { InstrumentThrottle(it) } ?: InstrumentThrottle.DEFAULT,
60+
meta = json.getJsonObject("meta")?.associate { it.key to it.value } ?: emptyMap()
6161
)
6262

6363
override fun toJson(): JsonObject {

0 commit comments

Comments
 (0)