Close stream on key export to avoid partial write (see #986)
This commit is contained in:
@@ -494,6 +494,13 @@ public class ImportExportOperation extends BaseOperation {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.add(LogType.MSG_EXPORT_ERROR_IO, 1);
|
log.add(LogType.MSG_EXPORT_ERROR_IO, 1);
|
||||||
return new ExportResult(ExportResult.RESULT_ERROR, log, okPublic, okSecret);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user