From ec7ad6338fd856d3c7f18e170722b70b94604969 Mon Sep 17 00:00:00 2001 From: Maxim Nikolenko Date: Thu, 23 Jan 2025 20:53:03 +0200 Subject: #3451 Crash at LLFloaterSnapshot::Impl::getActivePanel --- indra/newview/llfloatersnapshot.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'indra/newview/llfloatersnapshot.cpp') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index fb4537f22a..68b9e758a1 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -60,6 +60,10 @@ LLPanelSnapshot* LLFloaterSnapshot::Impl::getActivePanel(LLFloaterSnapshotBase* { LLSideTrayPanelContainer* panel_container = floater->getChild("panel_container"); LLPanelSnapshot* active_panel = dynamic_cast(panel_container->getCurrentPanel()); + if (!active_panel) + { + LL_WARNS() << "No snapshot active panel, current panel index: " << panel_container->getCurrentPanelIndex() << LL_ENDL; + } if (!ok_if_not_found) { llassert_always(active_panel != NULL); @@ -643,20 +647,18 @@ void LLFloaterSnapshotBase::ImplBase::setWorking(bool working) working_lbl->setVisible(working); mFloater->getChild("working_indicator")->setVisible(working); - if (working) - { - const std::string panel_name = getActivePanel(mFloater, false)->getName(); - const std::string prefix = panel_name.substr(getSnapshotPanelPrefix().size()); - std::string progress_text = mFloater->getString(prefix + "_" + "progress_str"); - working_lbl->setValue(progress_text); - } - // All controls should be disabled while posting. mFloater->setCtrlsEnabled(!working); - LLPanelSnapshot* active_panel = getActivePanel(mFloater); - if (active_panel) + if (LLPanelSnapshot* active_panel = getActivePanel(mFloater)) { active_panel->enableControls(!working); + if (working) + { + const std::string panel_name = active_panel->getName(); + const std::string prefix = panel_name.substr(getSnapshotPanelPrefix().size()); + std::string progress_text = mFloater->getString(prefix + "_" + "progress_str"); + working_lbl->setValue(progress_text); + } } } -- cgit v1.2.3