mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-05-29 04:50:15 +02:00
fix(app/updater): json null exception
This commit is contained in:
parent
4fe386e227
commit
d5b47e3e17
@ -41,7 +41,7 @@ object Updater {
|
||||
JsonParser.parseString(it.body.string()).asJsonObject
|
||||
}
|
||||
val debugRuns = actionRuns.getAsJsonArray("workflow_runs")?.mapNotNull { it.asJsonObject }?.filter { run ->
|
||||
run.getAsJsonPrimitive("conclusion")?.asString == "success" && run.getAsJsonPrimitive("path")?.asString == ".github/workflows/debug.yml"
|
||||
run.get("conclusion")?.takeIf { it.isJsonPrimitive }?.asString == "success" && run.getAsJsonPrimitive("path")?.asString == ".github/workflows/debug.yml"
|
||||
} ?: throw Throwable("No debug CI runs found")
|
||||
|
||||
val latestRun = debugRuns.firstOrNull() ?: throw Throwable("No debug CI runs found")
|
||||
|
Loading…
x
Reference in New Issue
Block a user