Fix wrong password detection

This commit is contained in:
Sylvia van Os
2022-04-17 14:25:26 +02:00
parent cfbaeb1ffc
commit de6248a5d6

View File

@@ -54,7 +54,12 @@ public class MultiFormatImporter {
database.setTransactionSuccessful();
return new ImportExportResult(ImportExportResultType.Success);
} catch (ZipException e) {
return new ImportExportResult(ImportExportResultType.BadPassword);
if (e.getType().equals(ZipException.Type.WRONG_PASSWORD)) {
return new ImportExportResult(ImportExportResultType.BadPassword);
} else {
Log.e(TAG, "Failed to import data", e);
error = e.toString();
}
} catch (Exception e) {
Log.e(TAG, "Failed to import data", e);
error = e.toString();