fix: show error message if cause is null

This commit is contained in:
oSumAtrIX 2022-08-14 17:22:43 +02:00
parent b19e1131e8
commit f9da2ad531
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -276,7 +276,8 @@ class Patcher(private val options: PatcherOptions) {
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 '${patchDependency.patchName}' but the following error was raised: $errorMessage")
}