Skip to content

Commit

Permalink
Fixup code
Browse files Browse the repository at this point in the history
  • Loading branch information
droidmonkey committed Jun 24, 2023
1 parent d4776ca commit abc84fc
Show file tree
Hide file tree
Showing 2 changed files with 457 additions and 407 deletions.
7 changes: 5 additions & 2 deletions src/gui/dbsettings/DatabaseSettingsWidgetEncryption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ void DatabaseSettingsWidgetEncryption::loadKdfParameters()
}

auto kdf = m_db->kdf();
Q_ASSERT(kdf);
if (!kdf) {
return;
}
Expand Down Expand Up @@ -384,7 +383,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
Loading

0 comments on commit abc84fc

Please sign in to comment.