Skip to content

Commit

Permalink
Stop the crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed May 31, 2021
1 parent 11b3595 commit 2473114
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ void DatabaseSettingsWidgetEncryption::loadKdfParameters()
}

auto kdf = m_db->kdf();
Q_ASSERT(kdf);
if (!kdf) {
return;
}
Expand Down Expand Up @@ -377,7 +376,11 @@ void DatabaseSettingsWidgetEncryption::setAdvancedMode(bool advanced)
if (advanced) {
loadKdfParameters();
} else {
m_ui->compatibilitySelection->setCurrentIndex(m_db->kdf()->uuid() == KeePass2::KDF_AES_KDBX3 ? KDBX3 : KDBX4);
auto version = KDBX4;
if (m_db->kdf()) {
version = (m_db->kdf()->uuid() == KeePass2::KDF_AES_KDBX3) ? KDBX3 : KDBX4;
}
m_ui->compatibilitySelection->setCurrentIndex(version);
}

m_ui->advancedSettings->setVisible(advanced);
Expand Down

0 comments on commit 2473114

Please sign in to comment.