From be222cd87773f3f1920f740a28cf0a1ad2dc74ea Mon Sep 17 00:00:00 2001 From: Alexander Bakker Date: Mon, 14 May 2018 18:49:28 +0200 Subject: [PATCH] Fix a NullPointerException in the intro --- app/src/main/java/me/impy/aegis/ui/IntroActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/me/impy/aegis/ui/IntroActivity.java b/app/src/main/java/me/impy/aegis/ui/IntroActivity.java index d82b3ddf..81d81645 100644 --- a/app/src/main/java/me/impy/aegis/ui/IntroActivity.java +++ b/app/src/main/java/me/impy/aegis/ui/IntroActivity.java @@ -146,7 +146,7 @@ public class IntroActivity extends AppIntro implements DerivationTask.Callback { masterKey = MasterKey.generate(); } - SlotCollection slots = _databaseFile.getSlots(); + SlotCollection slots = null; if (cryptType != CustomAuthenticationSlide.CRYPT_TYPE_NONE) { // encrypt the master key with a key derived from the user's password // and add it to the list of slots @@ -154,8 +154,10 @@ public class IntroActivity extends AppIntro implements DerivationTask.Callback { throw new RuntimeException(); } try { + slots = new SlotCollection(); slots.encrypt(_passwordSlot, masterKey, _passwordCipher); slots.add(_passwordSlot); + _databaseFile.setSlots(slots); } catch (SlotException e) { setException(e); }