cleanup: Fix a Coverity warning

Two pointers were checked against NULL and then both were
dereferenced if at least one was not NULL. Of course, this
should have been an and, not an or expression.

That said, this is a semi-false positive, since both pointers
are set in the constructor and therefore never can be NULL.
In principle, one could remove the whole check. Of course,
realizing that would require a global analysis by Coverity,
which I reckon it doesn't do.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-02-15 06:18:37 +01:00 committed by Dirk Hohndel
parent ab8533eeaa
commit 06d7ba082e

View file

@ -328,7 +328,7 @@ void FilterConstraintWidget::update()
} }
// Update the unit strings in case the locale was changed // Update the unit strings in case the locale was changed
if (unitFrom || unitTo) { if (unitFrom && unitTo) {
QString unitString = idx.data(FilterConstraintModel::UNIT_ROLE).value<QString>(); QString unitString = idx.data(FilterConstraintModel::UNIT_ROLE).value<QString>();
unitFrom->setText(unitString); unitFrom->setText(unitString);
unitTo->setText(unitString); unitTo->setText(unitString);