From b3fcfa16ba8b984163c38904e165052a34be6dab Mon Sep 17 00:00:00 2001
From: Steven Bennetts <steve@lindenlab.com>
Date: Thu, 3 Apr 2008 01:11:17 +0000
Subject: [PATCH] DEV-13060 - Crash when pressing TAB in quick search window.
 Reviewed by coco

---
 indra/llui/llpanel.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index c3afa040f81..fa48ebebe9c 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -293,7 +293,10 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
 		if (cur_focus)
 		{
 			LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot();
-			handled = focus_root->focusPrevItem(FALSE);
+			if (focus_root)
+			{
+				handled = focus_root->focusPrevItem(FALSE);
+			}
 		}
 	}
 	else if( (mask == MASK_NONE ) && (KEY_TAB == key))	
@@ -302,7 +305,10 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
 		if (cur_focus)
 		{
 			LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot();
-			handled = focus_root->focusNextItem(FALSE);
+			if (focus_root)
+			{
+				handled = focus_root->focusNextItem(FALSE);
+			}
 		}
 	}
 
-- 
GitLab