mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-29 13:27:46 +00:00
PGPKeyImportActivity: close key stream after use
This commit is contained in:
parent
d646415977
commit
6ceedc049c
@ -34,7 +34,7 @@ class PGPKeyImportActivity : AppCompatActivity() {
|
||||
val keyInputStream =
|
||||
contentResolver.openInputStream(uri)
|
||||
?: throw IllegalStateException("Failed to open selected file")
|
||||
val bytes = keyInputStream.readBytes()
|
||||
val bytes = keyInputStream.use { `is` -> `is`.readBytes() }
|
||||
val (key, error) = runBlocking { keyManager.addKey(PGPKey(bytes)) }
|
||||
if (error != null) throw error
|
||||
key
|
||||
|
Loading…
x
Reference in New Issue
Block a user