cleanup: fix over-eager Coverity warnings
Technically get_dive(i) could return a nullptr. But given the range for i that can never happen. Still, the test is extremely cheap and doesn't hurt. Fixes CID 354768 Fixes CID 354766 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b7a586a5b4
commit
a64787f70d
@ -716,6 +716,8 @@ void DiveTripModelTree::populate()
|
||||
uiNotification(QObject::tr("start processing"));
|
||||
for (int i = 0; i < dive_table.nr; ++i) {
|
||||
dive *d = get_dive(i);
|
||||
if (!d) // should never happen
|
||||
continue;
|
||||
update_cylinder_related_info(d);
|
||||
if (d->hidden_by_filter)
|
||||
continue;
|
||||
@ -1482,7 +1484,7 @@ void DiveTripModelList::populate()
|
||||
items.reserve(dive_table.nr);
|
||||
for (int i = 0; i < dive_table.nr; ++i) {
|
||||
dive *d = get_dive(i);
|
||||
if (d->hidden_by_filter)
|
||||
if (!d || d->hidden_by_filter)
|
||||
continue;
|
||||
items.push_back(d);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user