summaryrefslogtreecommitdiffstats
path: root/qt-models/filtermodels.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-27 07:36:35 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-27 07:35:46 -0700
commit130946fcf45375283661547502c389390bc2d443 (patch)
tree3f54f0a1ad754e84ab8ed88cbca2b98f7bc8d223 /qt-models/filtermodels.cpp
parent33137c62b05006bb2bf3925b1e504a95f356830e (diff)
downloadsubsurface-130946fcf45375283661547502c389390bc2d443.tar.gz
Cleanup: NULL check pointer before dereferencing
I we have no dive, whatever this is shouldn't be shown. Found by Coverity. Fixes CID 350093 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/filtermodels.cpp')
-rw-r--r--qt-models/filtermodels.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp
index 22a0d19cb..0226e1220 100644
--- a/qt-models/filtermodels.cpp
+++ b/qt-models/filtermodels.cpp
@@ -250,7 +250,7 @@ void MultiFilterSortModel::myInvalidate()
m->setData(idx, showTrip, DiveTripModelBase::SHOWN_ROLE);
} else {
dive *d = m->data(idx, DiveTripModelBase::DIVE_ROLE).value<dive *>();
- bool show = showDive(d);
+ bool show = (d != NULL) && showDive(d);
if (show)
divesDisplayed++;
m->setData(idx, show, DiveTripModelBase::SHOWN_ROLE);