summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewnotecard.cpp
diff options
context:
space:
mode:
authorsimon@lindenlab.com <simon@lindenlab.com>2011-06-27 10:15:24 -0700
committersimon@lindenlab.com <simon@lindenlab.com>2011-06-27 10:15:24 -0700
commitd40bd76ec76bf7d2fa59d15f5c71125c9813f31e (patch)
tree5e47be32903db5e8ff5520bd7ec46aad2f43adad /indra/newview/llpreviewnotecard.cpp
parent398019ffb2a036813c6c89a677e9534faa178330 (diff)
parent5c9fc7d24f0d060bcb86ed5b03cb9ba9c7282038 (diff)
Merge viewer 2.7.6 from trunk
Diffstat (limited to 'indra/newview/llpreviewnotecard.cpp')
-rw-r--r--indra/newview/llpreviewnotecard.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp
index 9f3ee6ac5d..4974dde282 100644
--- a/indra/newview/llpreviewnotecard.cpp
+++ b/indra/newview/llpreviewnotecard.cpp
@@ -401,15 +401,14 @@ struct LLSaveNotecardInfo
bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
{
- if(!gAssetStorage)
+ LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
+
+ if(!editor)
{
- llwarns << "Not connected to an asset storage system." << llendl;
+ llwarns << "Cannot get handle to the notecard editor." << llendl;
return false;
}
-
- LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
-
if(!editor->isPristine())
{
// We need to update the asset information
@@ -436,8 +435,15 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
// save it out to database
if (item)
{
- std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
- std::string task_url = gAgent.getRegion()->getCapability("UpdateNotecardTaskInventory");
+ const LLViewerRegion* region = gAgent.getRegion();
+ if (!region)
+ {
+ llwarns << "Not connected to a region, cannot save notecard." << llendl;
+ return false;
+ }
+ std::string agent_url = region->getCapability("UpdateNotecardAgentInventory");
+ std::string task_url = region->getCapability("UpdateNotecardTaskInventory");
+
if (mObjectUUID.isNull() && !agent_url.empty())
{
// Saving into agent inventory
@@ -472,6 +478,11 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
(void*)info,
FALSE);
}
+ else // !gAssetStorage
+ {
+ llwarns << "Not connected to an asset storage system." << llendl;
+ return false;
+ }
}
}
return true;