From d7060eb323f7cfebb7576e2999f782e8617e40e8 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Sat, 13 Feb 2010 14:08:58 +0000
Subject: [PATCH] CID-205

Checker: REVERSE_INULL
Function: LLPanel::fromXML(LLPointer<LLXMLNode>, LLView *, LLPointer<LLXMLNode>)
File: /indra/llui/llpanel.cpp
---
 indra/llui/llpanel.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 7b406e090ab..d963cf4c988 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -397,6 +397,12 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
 		if (!panelp)
 		{
 			panelp = LLUICtrlFactory::getInstance()->createFactoryPanel(name);
+			llassert(panelp);
+			
+			if (!panelp)
+			{
+				return NULL; // :(
+			}
 		}
 
 	}
@@ -414,7 +420,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
 	panelp->mCommitCallbackRegistrar.popScope();
 	panelp->mEnableCallbackRegistrar.popScope();
 
-	if (panelp && !panelp->getFactoryMap().empty())
+	if (!panelp->getFactoryMap().empty())
 	{
 		LLUICtrlFactory::instance().popFactoryFunctions();
 	}
-- 
GitLab