┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Torres <[email protected]>2011-10-09 11:12:22 +0200
committerJaime Torres <[email protected]>2011-10-09 11:12:22 +0200
commitc9156fdaf9dd3f5bad649659a2533a561deb90e0 (patch)
tree71ad8c716dce86010cfb94da7ed360788b192c3f
parent0ebf2d1fe0c28f9b587629ecf0e57971880eeeb0 (diff)
avoid two possible null pointer dereferences
move the setToolTip lines outside the if(action) inside it. do not crash if there is no action.
-rw-r--r--src/dolphinmainwindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 1150b7488..1b2b971c2 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -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);
}
}