mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-26 22:36:59 -05:00
Remove redundant null-checks for pointer deletion
Deleting a null pointer is defined behavior and results in a no-op at the assembly level, so it's perfectly safe.
This commit is contained in:
parent
4ac1601696
commit
18fd20f898
@ -143,7 +143,7 @@ void DatabaseOpenWidget::load(const QString& filename)
|
|||||||
|
|
||||||
QHash<QString, QVariant> useTouchID = config()->get("UseTouchID").toHash();
|
QHash<QString, QVariant> useTouchID = config()->get("UseTouchID").toHash();
|
||||||
m_ui->checkTouchID->setChecked(useTouchID.value(m_filename, false).toBool());
|
m_ui->checkTouchID->setChecked(useTouchID.value(m_filename, false).toBool());
|
||||||
|
|
||||||
m_ui->editPassword->setFocus();
|
m_ui->editPassword->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,9 +195,9 @@ void DatabaseOpenWidget::openDatabase()
|
|||||||
MessageWidget::Error);
|
MessageWidget::Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_db) {
|
|
||||||
delete m_db;
|
delete m_db;
|
||||||
}
|
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
m_db = reader.readDatabase(&file, masterKey);
|
m_db = reader.readDatabase(&file, masterKey);
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
@ -254,7 +254,7 @@ QSharedPointer<CompositeKey> DatabaseOpenWidget::databaseKey()
|
|||||||
// check if the user cancelled the operation
|
// check if the user cancelled the operation
|
||||||
if (passwordKey.isNull())
|
if (passwordKey.isNull())
|
||||||
return QSharedPointer<CompositeKey>();
|
return QSharedPointer<CompositeKey>();
|
||||||
|
|
||||||
masterKey->addKey(PasswordKey::fromRawKey(*passwordKey));
|
masterKey->addKey(PasswordKey::fromRawKey(*passwordKey));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,9 @@ void KeePass1OpenWidget::openDatabase()
|
|||||||
MessageWidget::Error);
|
MessageWidget::Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_db) {
|
|
||||||
delete m_db;
|
delete m_db;
|
||||||
}
|
|
||||||
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
|
||||||
m_db = reader.readDatabase(&file, password, keyFileName);
|
m_db = reader.readDatabase(&file, password, keyFileName);
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user