Nullcheck in LLMenuItemBranchDownGL::setHighlight (getBranch())

This commit is contained in:
Shyotl
2011-10-14 22:58:27 -05:00
parent 4a910a8037
commit e432943781

View File

@@ -1501,20 +1501,26 @@ void LLMenuItemBranchDownGL::openMenu( void )
// set the hover status (called by it's menu) // set the hover status (called by it's menu)
void LLMenuItemBranchDownGL::setHighlight( BOOL highlight ) void LLMenuItemBranchDownGL::setHighlight( BOOL highlight )
{ {
if (highlight == getHighlight()) return; if (highlight == getHighlight())
return;
//NOTE: Purposely calling all the way to the base to bypass auto-open. //NOTE: Purposely calling all the way to the base to bypass auto-open.
LLMenuItemGL::setHighlight(highlight); LLMenuItemGL::setHighlight(highlight);
LLMenuGL* branch = getBranch();
if (!branch)
return;
if( !highlight) if( !highlight)
{ {
if (getBranch()->getTornOff()) if (branch->getTornOff())
{ {
((LLFloater*)getBranch()->getParent())->setFocus(FALSE); ((LLFloater*)branch->getParent())->setFocus(FALSE);
getBranch()->clearHoverItem(); branch->clearHoverItem();
} }
else else
{ {
getBranch()->setVisible( FALSE ); branch->setVisible( FALSE );
} }
} }
} }