mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-01-31 15:10:19 -05:00
Close stream on key export to avoid partial write (see #986)
This commit is contained in:
parent
727783dd00
commit
e1285eec7b
@ -494,6 +494,13 @@ public class ImportExportOperation extends BaseOperation {
|
||||
} catch (IOException e) {
|
||||
log.add(LogType.MSG_EXPORT_ERROR_IO, 1);
|
||||
return new ExportResult(ExportResult.RESULT_ERROR, log, okPublic, okSecret);
|
||||
} finally {
|
||||
// Make sure the stream is closed
|
||||
if (outStream != null) try {
|
||||
outStream.close();
|
||||
} catch (Exception e) {
|
||||
Log.e(Constants.TAG, "error closing stream", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user