From 5e85642650d4ffa822b749c5a4a211531545d660 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Fri, 6 Nov 2009 18:04:29 -0800 Subject: Temp fix to prevent crash while missing sidepanel_task_info.xml. --- indra/newview/llsidepanelinventory.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 3a1b354c50..6aa5c53194 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -95,8 +95,11 @@ BOOL LLSidepanelInventory::postBuild() // UI elements from task panel { mTaskPanel = getChild("sidepanel__task_panel"); - LLButton* back_btn = mTaskPanel->getChild("back_btn"); - back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + if (mTaskPanel) + { + LLButton* back_btn = mTaskPanel->getChild("back_btn"); + back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); + } } return TRUE; @@ -120,7 +123,8 @@ void LLSidepanelInventory::onOpen(const LLSD& key) } if (key.has("task")) { - mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); + if (mTaskPanel) + mTaskPanel->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); showTaskInfoPanel(); } } @@ -184,7 +188,8 @@ void LLSidepanelInventory::onSelectionChange(const std::deque void LLSidepanelInventory::showItemInfoPanel() { mItemPanel->setVisible(TRUE); - mTaskPanel->setVisible(FALSE); + if (mTaskPanel) + mTaskPanel->setVisible(FALSE); mInventoryPanel->setVisible(FALSE); mItemPanel->dirty(); @@ -194,17 +199,21 @@ void LLSidepanelInventory::showItemInfoPanel() void LLSidepanelInventory::showTaskInfoPanel() { mItemPanel->setVisible(FALSE); - mTaskPanel->setVisible(TRUE); mInventoryPanel->setVisible(FALSE); - mTaskPanel->dirty(); - mTaskPanel->setIsEditing(FALSE); + if (mTaskPanel) + { + mTaskPanel->setVisible(TRUE); + mTaskPanel->dirty(); + mTaskPanel->setIsEditing(FALSE); + } } void LLSidepanelInventory::showInventoryPanel() { mItemPanel->setVisible(FALSE); - mTaskPanel->setVisible(FALSE); + if (mTaskPanel) + mTaskPanel->setVisible(FALSE); mInventoryPanel->setVisible(TRUE); updateVerbs(); } -- cgit v1.2.3