mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 12:57:57 +01:00
Fix NPE in DecryptExternal when reading lines
This commit is contained in:
parent
1df5747549
commit
4388f00dc0
1 changed files with 3 additions and 3 deletions
|
@ -108,8 +108,8 @@ class DecryptExternal(
|
||||||
finish(process)
|
finish(process)
|
||||||
|
|
||||||
val sessionKeyOutIn = FileInputStream(sessionKeyOut)
|
val sessionKeyOutIn = FileInputStream(sessionKeyOut)
|
||||||
var line = readString(sessionKeyOutIn)
|
var line: String? = readString(sessionKeyOutIn)
|
||||||
val sessionKey = SessionKey.fromString(line.trim { it <= ' ' })
|
val sessionKey = line?.let { l -> SessionKey.fromString(l.trim { it <= ' ' }) }
|
||||||
sessionKeyOutIn.close()
|
sessionKeyOutIn.close()
|
||||||
sessionKeyOut.delete()
|
sessionKeyOut.delete()
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ class DecryptExternal(
|
||||||
val verifyOutIn = FileInputStream(verifyOut)
|
val verifyOutIn = FileInputStream(verifyOut)
|
||||||
val reader = BufferedReader(InputStreamReader(verifyOutIn))
|
val reader = BufferedReader(InputStreamReader(verifyOutIn))
|
||||||
while (reader.readLine().also { line = it } != null) {
|
while (reader.readLine().also { line = it } != null) {
|
||||||
verifications.add(Verification.fromString(line.trim()))
|
line?.let { verifications.add(Verification.fromString(it.trim())) }
|
||||||
}
|
}
|
||||||
reader.close()
|
reader.close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue