Skip to content

Commit 22c9ab7

Browse files
Merge pull request #1295 from alexbakker/intro-init-crash
Don't initialize VaultManager after the intro unless saving succeeds
2 parents f8ad3d1 + 8bbbe36 commit 22c9ab7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/src/main/java/com/beemdevelopment/aegis/vault/VaultManager.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ public VaultRepository initNew(@Nullable VaultFileCredentials creds) throws Vaul
5555
throw new IllegalStateException("Vault manager is already initialized");
5656
}
5757

58-
_repo = new VaultRepository(_context, new Vault(), creds);
59-
save();
58+
VaultRepository repo = new VaultRepository(_context, new Vault(), creds);
59+
repo.save();
60+
_repo = repo;
6061

6162
if (getVault().isEncryptionEnabled()) {
6263
startNotificationService();

0 commit comments

Comments
 (0)