Merge branch 'master' into v/multi-decrypt

This commit is contained in:
Vincent Breitmoser
2015-06-17 21:33:31 +02:00
9 changed files with 101 additions and 79 deletions

View File

@@ -411,13 +411,17 @@ public class ImportExportOperation extends BaseOperation {
try {
OutputStream outStream = new FileOutputStream(outputFile);
ExportResult result = exportKeyRings(log, masterKeyIds, exportSecret, outStream);
if (result.cancelled()) {
//noinspection ResultOfMethodCallIgnored
new File(outputFile).delete();
try {
ExportResult result = exportKeyRings(log, masterKeyIds, exportSecret, outStream);
if (result.cancelled()) {
//noinspection ResultOfMethodCallIgnored
new File(outputFile).delete();
}
return result;
} finally {
outStream.close();
}
return result;
} catch (FileNotFoundException e) {
} catch (IOException e) {
log.add(LogType.MSG_EXPORT_ERROR_FOPEN, 1);
return new ExportResult(ExportResult.RESULT_ERROR, log);
}