Skip to content

Commit 7c9ece7

Browse files
committed
Handle potentially null json
1 parent 10cdff2 commit 7c9ece7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/com/coder/gateway/sdk/CoderCLIManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class CoderCLIManager @JvmOverloads constructor(
291291
return try {
292292
val raw = exec("version", "--output", "json")
293293
val json = Gson().fromJson(raw, Version::class.java)
294-
json.version
294+
json?.version
295295
} catch (e: Exception) {
296296
logger.warn("Unable to determine CLI version: ${e.message}")
297297
null

0 commit comments

Comments
 (0)