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>
This commit is contained in:
Dirk Hohndel 2019-10-27 07:36:35 -04:00
parent 33137c62b0
commit 130946fcf4

View file

@ -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);