From cd08c3f3600b62f6adbfb8c7cf8830d331d40cd4 Mon Sep 17 00:00:00 2001 From: Nicky Date: Fri, 10 Apr 2015 00:07:38 +0200 Subject: [PATCH] Fix some crashyness from FIRE-15524. --- indra/newview/llpreviewscript.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 7bfdbe55ec..be625e50db 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2429,6 +2429,16 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, { if( LL_ERR_NOERR == status ) { + // FIRE-15524 opt to not crash if the item went away .... + if( !instance->getItem() ) + { + LL_WARNS() << "getItem() returns 0, item went away while loading script()" << LL_ENDL; + instance->mAssetStatus = PREVIEW_ASSET_ERROR; + delete xored_id; + return; + } + // + instance->loadScriptText(vfs, asset_id, type); instance->mScriptEd->setEnableEditing(TRUE); instance->mAssetStatus = PREVIEW_ASSET_LOADED;