mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 23:39:45 -05:00
Fix crash when building history changes
* Replace rarely hit asserts with defined nullptr checks when replacing references without a group * Fix #7603 * Replace TOTP history comparison with checking the actual TOTP output instead of a compiled string
This commit is contained in:
parent
48a3fd8e3c
commit
44be95cc1b
@ -1139,7 +1139,7 @@ QString Entry::resolveReferencePlaceholderRecursive(const QString& placeholder,
|
||||
// using format from http://keepass.info/help/base/fieldrefs.html at the time of writing
|
||||
|
||||
QRegularExpressionMatch match = EntryAttributes::matchReference(placeholder);
|
||||
if (!match.hasMatch()) {
|
||||
if (!match.hasMatch() || !m_group || !m_group->database()) {
|
||||
return placeholder;
|
||||
}
|
||||
|
||||
@ -1149,8 +1149,6 @@ QString Entry::resolveReferencePlaceholderRecursive(const QString& placeholder,
|
||||
|
||||
const EntryReferenceType searchInType = Entry::referenceType(searchIn);
|
||||
|
||||
Q_ASSERT(m_group);
|
||||
Q_ASSERT(m_group->database());
|
||||
const Entry* refEntry = m_group->database()->rootGroup()->findEntryBySearchTerm(searchText, searchInType);
|
||||
|
||||
if (refEntry) {
|
||||
|
@ -232,7 +232,7 @@ void EntryHistoryModel::calculateHistoryModifications()
|
||||
|| curr->timeInfo().expiryTime() != compare->timeInfo().expiryTime()) {
|
||||
modifiedFields << tr("Expiration");
|
||||
}
|
||||
if (curr->totpSettingsString() != compare->totpSettingsString()) {
|
||||
if (curr->totp() != compare->totp()) {
|
||||
modifiedFields << tr("TOTP");
|
||||
}
|
||||
if (*curr->customData() != *compare->customData()) {
|
||||
|
Loading…
Reference in New Issue
Block a user