From 78850a2233374d8afc3c04ae8e515419a16ca792 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Tue, 8 Sep 2020 09:16:33 -0400
Subject: [PATCH] Fix deep find widget recursion when script button popup is
 being shown

---
 indra/llui/lldockcontrol.cpp | 7 ++++++-
 indra/llui/lldockcontrol.h   | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index bd42497cb66..7ef2b9822ce 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -74,6 +74,8 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
 	{
 		mDockWidgetVisible = false;
 	}
+
+	mNonToolbarPanelHandle = dockableFloater->getRootView()->getChild<LLView>("non_toolbar_panel")->getHandle();
 }
 
 LLDockControl::~LLDockControl()
@@ -97,7 +99,10 @@ void LLDockControl::setDock(LLView* dockWidget)
 
 void LLDockControl::getAllowedRect(LLRect& rect)
 {
-	rect = mDockableFloater->getRootView()->getChild<LLView>("non_toolbar_panel")->getRect();
+	if (!mNonToolbarPanelHandle.isDead())
+	{
+		rect = mNonToolbarPanelHandle.get()->getRect();
+	}
 }
 
 void LLDockControl::repositionDockable()
diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h
index 98a9c7236d7..140e82fbdf8 100644
--- a/indra/llui/lldockcontrol.h
+++ b/indra/llui/lldockcontrol.h
@@ -84,6 +84,7 @@ class LLDockControl
 	bool mDockWidgetVisible;
 	DocAt mDockAt;
 	LLHandle<LLView> mDockWidgetHandle;
+	LLHandle<LLView> mNonToolbarPanelHandle;
 	LLRect mPrevDockRect;
 	LLRect mRootRect;
 	LLRect mFloaterRect;
-- 
GitLab