Merge pull request #570 from alexbakker/fix-double-add-crash

Prevent a crash caused by adding the same entry to the vault twice
pull/573/head
Michael Schättgen 5 years ago committed by GitHub
commit 875c752f78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -452,7 +452,11 @@ public class EditEntryActivity extends AegisActivity {
}
private void addAndFinish(VaultEntry entry) {
if (_isNew) {
// It's possible that the new entry was already added to the vault, but writing the
// vault to disk failed, causing the user to tap 'Save' again. Calling addEntry
// again would cause a crash in that case, so the isEntryDuplicate check prevents
// that.
if (_isNew && !_vault.isEntryDuplicate(entry)) {
_vault.addEntry(entry);
} else {
_vault.replaceEntry(entry);

Loading…
Cancel
Save