mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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);
|
m->setData(idx, showTrip, DiveTripModelBase::SHOWN_ROLE);
|
||||||
} else {
|
} else {
|
||||||
dive *d = m->data(idx, DiveTripModelBase::DIVE_ROLE).value<dive *>();
|
dive *d = m->data(idx, DiveTripModelBase::DIVE_ROLE).value<dive *>();
|
||||||
bool show = showDive(d);
|
bool show = (d != NULL) && showDive(d);
|
||||||
if (show)
|
if (show)
|
||||||
divesDisplayed++;
|
divesDisplayed++;
|
||||||
m->setData(idx, show, DiveTripModelBase::SHOWN_ROLE);
|
m->setData(idx, show, DiveTripModelBase::SHOWN_ROLE);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue