From 8d95b14f350b47ec029f35e776f6e627aaf5f607 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Mon, 1 Aug 2022 18:36:11 +0200 Subject: [PATCH] fix: show error message instead of `null` --- src/main/kotlin/app/revanced/patcher/Patcher.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patcher/Patcher.kt b/src/main/kotlin/app/revanced/patcher/Patcher.kt index c03db12..2f5625e 100644 --- a/src/main/kotlin/app/revanced/patcher/Patcher.kt +++ b/src/main/kotlin/app/revanced/patcher/Patcher.kt @@ -274,7 +274,9 @@ class Patcher(private val options: PatcherOptions) { val result = applyPatch(dependency, appliedPatches) if (result.isSuccess()) return@forEach - val errorMessage = result.error()!!.cause + val error = result.error()!! + val errorMessage = error.cause ?: error.message + return PatchResultError("'$patchName' depends on '${dependency.patchName}' but the following error was raised: $errorMessage") }