mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
avoid two possible null pointer dereferences
move the setToolTip lines outside the if(action) inside it. do not crash if there is no action.
This commit is contained in:
parent
0ebf2d1fe0
commit
c9156fdaf9
1 changed files with 2 additions and 2 deletions
|
@ -441,14 +441,14 @@ void DolphinMainWindow::updateHistory()
|
|||
const int index = urlNavigator->historyIndex();
|
||||
|
||||
QAction* backAction = actionCollection()->action("go_back");
|
||||
backAction->setToolTip(i18nc("@info", "Go back"));
|
||||
if (backAction) {
|
||||
backAction->setToolTip(i18nc("@info", "Go back"));
|
||||
backAction->setEnabled(index < urlNavigator->historySize() - 1);
|
||||
}
|
||||
|
||||
QAction* forwardAction = actionCollection()->action("go_forward");
|
||||
forwardAction->setToolTip(i18nc("@info", "Go forward"));
|
||||
if (forwardAction) {
|
||||
forwardAction->setToolTip(i18nc("@info", "Go forward"));
|
||||
forwardAction->setEnabled(index > 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue