mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
LibGUI: Fix null parent deref in AbstractButton::set_checked()
If a button is orphaned, there are no siblings anyway, so there's no need to try to update them.
This commit is contained in:
@@ -68,7 +68,7 @@ void AbstractButton::set_checked(bool checked)
|
||||
return;
|
||||
m_checked = checked;
|
||||
|
||||
if (is_exclusive() && checked) {
|
||||
if (is_exclusive() && checked && parent_widget()) {
|
||||
parent_widget()->for_each_child_of_type<AbstractButton>([&](auto& sibling) {
|
||||
if (!sibling.is_exclusive() || !sibling.is_checked())
|
||||
return IterationDecision::Continue;
|
||||
|
||||
Reference in New Issue
Block a user