diff --git a/src/util/ddciicon.cpp b/src/util/ddciicon.cpp index 57a3e13..17d1a31 100644 --- a/src/util/ddciicon.cpp +++ b/src/util/ddciicon.cpp @@ -598,6 +598,8 @@ void DDciIconPrivate::loadIconList() node.entries << icon; node.maxPaddings = qMax(node.maxPaddings, icon->maxPaddings); } + if (node.entries.isEmpty()) + continue; icons << std::move(node); } } @@ -646,7 +648,7 @@ DDciIconEntry *DDciIconPrivate::tryMatchIcon(int iconSize, DDciIcon::Theme theme } const auto targetIcon = std::max_element(iconWeight.constBegin(), iconWeight.constEnd()); - if (*targetIcon > 0) + if (targetIcon != iconWeight.constEnd() && *targetIcon > 0) return listOfSize.entries.at(targetIcon - iconWeight.constBegin()); return nullptr; }