From 9baa649389881043919c748192d9ad1461c7234a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 30 Oct 2020 16:44:56 +0100 Subject: [PATCH] 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. --- Libraries/LibGUI/AbstractButton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibGUI/AbstractButton.cpp b/Libraries/LibGUI/AbstractButton.cpp index 02e66e20b5..d4fba8c293 100644 --- a/Libraries/LibGUI/AbstractButton.cpp +++ b/Libraries/LibGUI/AbstractButton.cpp @@ -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([&](auto& sibling) { if (!sibling.is_exclusive() || !sibling.is_checked()) return IterationDecision::Continue;