Fix: Dereference of null pointer in FButtonGroup
This commit is contained in:
parent
bd1b9e7c90
commit
f493f7d480
|
@ -70,6 +70,9 @@ void FButtonGroup::init()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
bool FButtonGroup::isRadioButton(FToggleButton* button) const
|
bool FButtonGroup::isRadioButton(FToggleButton* button) const
|
||||||
{
|
{
|
||||||
|
if ( ! button )
|
||||||
|
return false;
|
||||||
|
|
||||||
return bool ( strcmp ( button->getClassName()
|
return bool ( strcmp ( button->getClassName()
|
||||||
, const_cast<char*>("FRadioButton") ) == 0 );
|
, const_cast<char*>("FRadioButton") ) == 0 );
|
||||||
}
|
}
|
||||||
|
@ -333,7 +336,10 @@ void FButtonGroup::hide()
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
void FButtonGroup::insert (FToggleButton* button)
|
void FButtonGroup::insert (FToggleButton* button)
|
||||||
{
|
{
|
||||||
if ( button && button->group() )
|
if ( ! button )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( button->group() )
|
||||||
button->group()->remove(button);
|
button->group()->remove(button);
|
||||||
|
|
||||||
// setChecked the first FRadioButton
|
// setChecked the first FRadioButton
|
||||||
|
@ -355,7 +361,7 @@ void FButtonGroup::remove (FToggleButton* button)
|
||||||
{
|
{
|
||||||
FButtonGroup::FButtonList::iterator iter;
|
FButtonGroup::FButtonList::iterator iter;
|
||||||
|
|
||||||
if ( buttonlist.empty() )
|
if ( ! button || buttonlist.empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
iter = buttonlist.begin();
|
iter = buttonlist.begin();
|
||||||
|
|
Loading…
Reference in New Issue