From 06d7ba082ebe5ccf06b8d95849d2713e02b7b022 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 15 Feb 2022 06:18:37 +0100 Subject: [PATCH] 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 --- desktop-widgets/filterconstraintwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop-widgets/filterconstraintwidget.cpp b/desktop-widgets/filterconstraintwidget.cpp index 6e5c2d032..508c65b77 100644 --- a/desktop-widgets/filterconstraintwidget.cpp +++ b/desktop-widgets/filterconstraintwidget.cpp @@ -328,7 +328,7 @@ void FilterConstraintWidget::update() } // Update the unit strings in case the locale was changed - if (unitFrom || unitTo) { + if (unitFrom && unitTo) { QString unitString = idx.data(FilterConstraintModel::UNIT_ROLE).value(); unitFrom->setText(unitString); unitTo->setText(unitString);