catch IllegalArgumentException when reading backup file

This commit is contained in:
Daniel Gultsch 2019-07-25 17:01:43 +02:00
parent 4957e50ac4
commit 238df77a1e
3 changed files with 4 additions and 4 deletions

View file

@ -137,7 +137,7 @@ public class ImportBackupService extends Service {
} else { } else {
backupFiles.add(backupFile); backupFiles.add(backupFile);
} }
} catch (IOException e) { } catch (IOException | IllegalArgumentException e) {
Log.d(Config.LOGTAG, "unable to read backup file ", e); Log.d(Config.LOGTAG, "unable to read backup file ", e);
} }
} }

View file

@ -124,7 +124,7 @@ public class ImportBackupActivity extends ActionBarActivity implements ServiceCo
try { try {
final ImportBackupService.BackupFile backupFile = ImportBackupService.BackupFile.read(this, uri); final ImportBackupService.BackupFile backupFile = ImportBackupService.BackupFile.read(this, uri);
showEnterPasswordDialog(backupFile, finishOnCancel); showEnterPasswordDialog(backupFile, finishOnCancel);
} catch (IOException e) { } catch (IOException | IllegalArgumentException e) {
Snackbar.make(binding.coordinator, R.string.not_a_backup_file, Snackbar.LENGTH_LONG).show(); Snackbar.make(binding.coordinator, R.string.not_a_backup_file, Snackbar.LENGTH_LONG).show();
} }
} }