fix: show error message instead of null

This commit is contained in:
oSumAtrIX 2022-08-01 18:36:11 +02:00
parent 9a4d30e152
commit 8d95b14f35
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -274,7 +274,9 @@ class Patcher(private val options: PatcherOptions) {
val result = applyPatch(dependency, appliedPatches) val result = applyPatch(dependency, appliedPatches)
if (result.isSuccess()) return@forEach 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") return PatchResultError("'$patchName' depends on '${dependency.patchName}' but the following error was raised: $errorMessage")
} }