From df45a4ef146a0eaa78d3a174bbc68bb67f0dee36 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Tue, 16 Jan 2018 16:08:08 +0200
Subject: [PATCH] MAINT-7732 Crash in LLLiveLSLEditor::loadScriptText(..)

---
 indra/newview/llpreviewscript.cpp | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 6ecc4c7fb91..945f3c370cd 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -2041,7 +2041,15 @@ void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType
 
 	mScriptEd->setScriptText(LLStringExplicit(&buffer[0]), TRUE);
 	mScriptEd->makeEditorPristine();
-	mScriptEd->setScriptName(getItem()->getName());
+
+	std::string script_name = DEFAULT_SCRIPT_NAME;
+	const LLInventoryItem* inv_item = getItem();
+
+	if(inv_item)
+	{
+		script_name = inv_item->getName();
+	}
+	mScriptEd->setScriptName(script_name);
 }
 
 
-- 
GitLab