From d5b47e3e17a870f224e6103542fb5f349bf87c6f Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sun, 8 Sep 2024 21:31:03 +0200 Subject: [PATCH] fix(app/updater): json null exception --- .../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 index 2652e65c..a4a40483 100644 --- 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")