mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-28 03:21:56 +00:00
Fix potential nullptr de-reference
The `break` that is replaced by a `return` here would only break out of the innermost while loop so the std::vector::end could still become accessed after that. By returning here we completely exit out of both nested loops and therefore don't access the std::vector::end.
This commit is contained in:
parent
1ea868f2f8
commit
eede574723
|
@ -56,7 +56,7 @@ void BackgroundColorHelper::slotPaletteChanged()
|
||||||
while (!*i) {
|
while (!*i) {
|
||||||
i = m_colorControlledWidgets.erase(i);
|
i = m_colorControlledWidgets.erase(i);
|
||||||
if (i == m_colorControlledWidgets.end()) {
|
if (i == m_colorControlledWidgets.end()) {
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setBackgroundColorForWidget(*i, m_backgroundColor);
|
setBackgroundColorForWidget(*i, m_backgroundColor);
|
||||||
|
|
Loading…
Reference in a new issue