fix crash when trying to enable fingerprint without password. (that doesn't mean it's now useful to do so)

This commit is contained in:
Philipp Crocoll
2017-05-09 06:35:57 +02:00
parent dbcb9ed55a
commit 9d07bb5d72

View File

@@ -187,7 +187,10 @@ namespace keepass2android
else else
{ {
if (_unlockMode == FingerprintUnlockMode.FullUnlock) if (_unlockMode == FingerprintUnlockMode.FullUnlock)
_enc.StoreEncrypted(App.Kp2a.GetDb().KpDatabase.MasterKey.GetUserKey<KcpPassword>().Password.ReadString(), CurrentPreferenceKey, edit); {
var userKey = App.Kp2a.GetDb().KpDatabase.MasterKey.GetUserKey<KcpPassword>();
_enc.StoreEncrypted(userKey != null ? userKey.Password.ReadString() : "", CurrentPreferenceKey, edit);
}
else else
_enc.StoreEncrypted("QuickUnlock" /*some dummy data*/, CurrentPreferenceKey, edit); _enc.StoreEncrypted("QuickUnlock" /*some dummy data*/, CurrentPreferenceKey, edit);
} }