Skip to content

Commit d5b47e3

Browse files
committed
fix(app/updater): json null exception
1 parent 4fe386e commit d5b47e3

File tree

1 file changed

+1
-1
lines changed
  • app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/data

1 file changed

+1
-1
lines changed

app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/data/Updater.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object Updater {
4141
JsonParser.parseString(it.body.string()).asJsonObject
4242
}
4343
val debugRuns = actionRuns.getAsJsonArray("workflow_runs")?.mapNotNull { it.asJsonObject }?.filter { run ->
44-
run.getAsJsonPrimitive("conclusion")?.asString == "success" && run.getAsJsonPrimitive("path")?.asString == ".github/workflows/debug.yml"
44+
run.get("conclusion")?.takeIf { it.isJsonPrimitive }?.asString == "success" && run.getAsJsonPrimitive("path")?.asString == ".github/workflows/debug.yml"
4545
} ?: throw Throwable("No debug CI runs found")
4646

4747
val latestRun = debugRuns.firstOrNull() ?: throw Throwable("No debug CI runs found")

0 commit comments

Comments
 (0)