mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-20 13:59:14 +00:00
Don't initialize VaultManager after the intro unless saving succeeds
In rare cases where writing to disk fails after the intro, a crash could occur if the user presses "Done" again. VaultManager would have been initialized, and trying to initialize it again would result in a crash.
This commit is contained in:
parent
2d0e201060
commit
8bbbe3611a
1 changed files with 3 additions and 2 deletions
|
@ -55,8 +55,9 @@ public class VaultManager {
|
|||
throw new IllegalStateException("Vault manager is already initialized");
|
||||
}
|
||||
|
||||
_repo = new VaultRepository(_context, new Vault(), creds);
|
||||
save();
|
||||
VaultRepository repo = new VaultRepository(_context, new Vault(), creds);
|
||||
repo.save();
|
||||
_repo = repo;
|
||||
|
||||
if (getVault().isEncryptionEnabled()) {
|
||||
startNotificationService();
|
||||
|
|
Loading…
Add table
Reference in a new issue