summaryrefslogtreecommitdiff
path: root/src/gui/widgets/guitable.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-17 18:55:36 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-17 18:55:36 +0300
commit4ecdb004e81a459ea63ebd7127e1c945df43f9ce (patch)
treea8ece58a62724c4b088484e0b5c1f44fdbf2f7e1 /src/gui/widgets/guitable.cpp
parent334c1c50dfa57da0b91687e097db295a6a3b699b (diff)
downloadplus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.gz
plus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.bz2
plus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.tar.xz
plus-4ecdb004e81a459ea63ebd7127e1c945df43f9ce.zip
Fix issues detected by coverity.
Diffstat (limited to 'src/gui/widgets/guitable.cpp')
-rw-r--r--src/gui/widgets/guitable.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 392755a20..9ff2075b1 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -593,6 +593,9 @@ void GuiTable::modelUpdated(const bool completed)
Widget *GuiTable::getWidgetAt(int x, int y)
{
+ if (mModel == nullptr)
+ return nullptr;
+
const int row = getRowForY(y);
const int column = getColumnForX(x);
@@ -602,7 +605,7 @@ Widget *GuiTable::getWidgetAt(int x, int y)
return mTopWidget;
}
- if ((mModel != nullptr) && row > -1 && column > -1)
+ if (row > -1 && column > -1)
{
Widget *const w = mModel->getElementAt(row, column);
if ((w != nullptr) && w->isFocusable())