diff --git a/src/kits/interface/RadioButton.cpp b/src/kits/interface/RadioButton.cpp index 906e0d7a11..8cfb7dcb88 100644 --- a/src/kits/interface/RadioButton.cpp +++ b/src/kits/interface/RadioButton.cpp @@ -14,6 +14,7 @@ */ +#include #include #include #include @@ -295,7 +296,7 @@ BRadioButton::SetValue(int32 value) while (child) { BRadioButton *radio = dynamic_cast(child); - if (child != this && radio) + if (radio && (radio != this)) radio->SetValue(B_CONTROL_OFF); else { // If the child is a BBox, check if the label is a radiobutton @@ -304,13 +305,15 @@ BRadioButton::SetValue(int32 value) if (box && box->LabelView()) { radio = dynamic_cast(box->LabelView()); - if (radio) + if (radio && (radio != this)) radio->SetValue(B_CONTROL_OFF); } } child = child->NextSibling(); } + + ASSERT(Value() == B_CONTROL_ON); }