mirror of
https://invent.kde.org/system/dolphin
synced 2024-07-15 18:01:11 +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) {
|
||||
i = m_colorControlledWidgets.erase(i);
|
||||
if (i == m_colorControlledWidgets.end()) {
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
setBackgroundColorForWidget(*i, m_backgroundColor);
|
||||
|
|
Loading…
Reference in a new issue