More careful null checking and member initalization.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user