Fix TouchID operation after database refactor

* Fix #2720
This commit is contained in:
Jonathan White 2019-02-24 18:31:55 -05:00
parent d0d1b25e5c
commit bbf678975f

View File

@ -251,7 +251,11 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
#ifdef WITH_XC_TOUCHID #ifdef WITH_XC_TOUCHID
// check if TouchID is available and enabled for unlocking the database // check if TouchID is available and enabled for unlocking the database
if (m_ui->checkTouchID->isChecked() && TouchID::getInstance().isAvailable() && masterKey->isEmpty()) { if (m_ui->checkTouchID->isChecked() && TouchID::getInstance().isAvailable()
&& m_ui->editPassword->text().isEmpty()) {
// clear empty password from composite key
masterKey->clear();
// try to get, decrypt and use PasswordKey // try to get, decrypt and use PasswordKey
QSharedPointer<QByteArray> passwordKey = TouchID::getInstance().getKey(m_filename); QSharedPointer<QByteArray> passwordKey = TouchID::getInstance().getKey(m_filename);
if (passwordKey != NULL) { if (passwordKey != NULL) {