More careful null checking and member initalization.

This commit is contained in:
Felix Geyer 2014-03-22 12:07:06 +01:00
parent 54bb7462f6
commit b9370c6e79
12 changed files with 32 additions and 26 deletions

View file

@ -226,7 +226,9 @@ void MainWindow::updateCopyAttributesMenu()
if (!dbWidget) {
return;
}
if (!dbWidget->entryView()->isSingleEntrySelected()) {
Entry* entry = dbWidget->entryView()->currentEntry();
if (!entry || !dbWidget->entryView()->isSingleEntrySelected()) {
return;
}
@ -235,8 +237,6 @@ void MainWindow::updateCopyAttributesMenu()
delete actions[i];
}
Entry* entry = dbWidget->entryView()->currentEntry();
Q_FOREACH (const QString& key, entry->attributes()->customKeys()) {
QAction* action = m_ui->menuEntryCopyAttribute->addAction(key);
m_copyAdditionalAttributeActions->addAction(action);