commit d5b47e3e17a870f224e6103542fb5f349bf87c6f parent 4fe386e2273976de75fbb5a0259bea9d195686b0 Author: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sun, 8 Sep 2024 21:31:03 +0200 fix(app/updater): json null exception Diffstat:
M | app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/data/Updater.kt | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/data/Updater.kt b/app/src/main/kotlin/me/rhunk/snapenhance/ui/manager/data/Updater.kt @@ -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")