mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 04:57:56 +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)
|
||||
|
||||
val sessionKeyOutIn = FileInputStream(sessionKeyOut)
|
||||
var line = readString(sessionKeyOutIn)
|
||||
val sessionKey = SessionKey.fromString(line.trim { it <= ' ' })
|
||||
var line: String? = readString(sessionKeyOutIn)
|
||||
val sessionKey = line?.let { l -> SessionKey.fromString(l.trim { it <= ' ' }) }
|
||||
sessionKeyOutIn.close()
|
||||
sessionKeyOut.delete()
|
||||
|
||||
|
@ -118,7 +118,7 @@ class DecryptExternal(
|
|||
val verifyOutIn = FileInputStream(verifyOut)
|
||||
val reader = BufferedReader(InputStreamReader(verifyOutIn))
|
||||
while (reader.readLine().also { line = it } != null) {
|
||||
verifications.add(Verification.fromString(line.trim()))
|
||||
line?.let { verifications.add(Verification.fromString(it.trim())) }
|
||||
}
|
||||
reader.close()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue