mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 12:57:57 +01:00
decrypt: Do not throw NoSignature exception when verifications is empty
This commit is contained in:
parent
51d9c29837
commit
e5e64003f3
1 changed files with 4 additions and 7 deletions
|
@ -85,13 +85,10 @@ class DecryptCmd : AbstractSopCmd() {
|
||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
private fun writeVerifyOut(result: DecryptionResult) {
|
private fun writeVerifyOut(result: DecryptionResult) {
|
||||||
verifyOut?.let {
|
verifyOut?.let {
|
||||||
if (result.verifications.isEmpty()) {
|
getOutput(it).use { out ->
|
||||||
val errorMsg = getMsg("sop.error.runtime.no_verifiable_signature_found")
|
PrintWriter(out).use { pw ->
|
||||||
throw NoSignature(errorMsg)
|
result.verifications.forEach { verification -> pw.println(verification) }
|
||||||
}
|
}
|
||||||
|
|
||||||
getOutput(verifyOut).use { out ->
|
|
||||||
PrintWriter(out).use { pw -> result.verifications.forEach { pw.println(it) } }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue