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:
parent
33137c62b0
commit
130946fcf4
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user