mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
272b7b3e27
commit
e30ba8a8e0
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue