From 5f08031bbdfe95caf657a975ba1b187004fd5619 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 15 Feb 2010 17:35:24 +0000 Subject: CID-135 Checker: NULL_RETURNS Function: LLPreviewLSL::postBuild() File: /indra/newview/llpreviewscript.cpp --- indra/newview/llpreviewscript.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 3221745fa3..ae7b30b55c 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -956,7 +956,10 @@ BOOL LLPreviewLSL::postBuild() const LLInventoryItem* item = getItem(); childSetCommitCallback("desc", LLPreview::onText, this); - childSetText("desc", item->getDescription()); + if (item) + { + childSetText("desc", item->getDescription()); + } childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); -- cgit v1.2.3 From fecaf7b64fdc3d9ebf1d32ddb1ed8b50904db534 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 15 Feb 2010 17:35:45 +0000 Subject: CID-135 followup --- indra/newview/llpreviewscript.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index ae7b30b55c..f5a9f82d50 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -955,11 +955,12 @@ BOOL LLPreviewLSL::postBuild() { const LLInventoryItem* item = getItem(); - childSetCommitCallback("desc", LLPreview::onText, this); + llassert(item); if (item) { childSetText("desc", item->getDescription()); } + childSetCommitCallback("desc", LLPreview::onText, this); childSetPrevalidate("desc", &LLTextValidate::validateASCIIPrintableNoPipe); return LLPreview::postBuild(); -- cgit v1.2.3