Skip to content

Commit fad4aaa

Browse files
committed
Avoid creating an empty ZIP file when exporting to QIF
It may happen when there aren't transactions to export.
1 parent 1711414 commit fad4aaa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/src/main/java/org/gnucash/android/export/qif/QifExporter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ public List<String> generateExport() throws ExporterException {
238238
/// export successful
239239
PreferencesHelper.setLastExportTime(TimestampHelper.getTimestampFromNow());
240240
List<String> exportedFiles = splitQIF(file);
241-
return zipQifs(exportedFiles);
241+
if (exportedFiles.isEmpty())
242+
return Collections.emptyList();
243+
else
244+
return zipQifs(exportedFiles);
242245
} catch (IOException e) {
243246
throw new ExporterException(mExportParams, e);
244247
}

0 commit comments

Comments
 (0)