mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue