Fix nullptr crash in LLFloaterIMContainer::onAddButtonClicked

master
Rye Mutt 2024-07-22 11:02:31 -04:00 committed by Andrey Kleshchev
parent b01b53b2fe
commit cd18835270
1 changed files with 7 additions and 4 deletions

View File

@ -988,11 +988,14 @@ void LLFloaterIMContainer::onAddButtonClicked()
{
LLView * button = findChild<LLView>("conversations_pane_buttons_expanded")->findChild<LLButton>("add_btn");
LLFloater* root_floater = gFloaterView->getParentFloater(this);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button);
if (picker && root_floater)
if (button && root_floater)
{
root_floater->addDependentFloater(picker);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button);
if (picker)
{
root_floater->addDependentFloater(picker);
}
}
}