Fix a NullPointerException in the intro

This commit is contained in:
Alexander Bakker 2018-05-14 18:49:28 +02:00
parent 972a1670eb
commit be222cd877

View file

@ -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);
}