summaryrefslogtreecommitdiff
path: root/indra/newview/llexperienceassociationresponder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llexperienceassociationresponder.cpp')
-rw-r--r--indra/newview/llexperienceassociationresponder.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llexperienceassociationresponder.cpp b/indra/newview/llexperienceassociationresponder.cpp
index b50c81eedc..f62ca7d75f 100644
--- a/indra/newview/llexperienceassociationresponder.cpp
+++ b/indra/newview/llexperienceassociationresponder.cpp
@@ -29,6 +29,7 @@
#include "llviewerprecompiledheaders.h"
#include "llexperienceassociationresponder.h"
#include "llexperiencecache.h"
+#include "llviewerobjectlist.h"
#include "llviewerregion.h"
#include "llagent.h"
@@ -47,7 +48,21 @@ void ExperienceAssociationResponder::fetchAssociatedExperience( const LLUUID& ob
void ExperienceAssociationResponder::fetchAssociatedExperience(LLSD& request, callback_t callback)
{
- LLViewerRegion* region = gAgent.getRegion();
+ LLViewerObject* object = gObjectList.findObject(request["object-id"]);
+ if (!object)
+ {
+ LL_DEBUGS() << "Object with ID " << request["object-id"] << " not found via gObjectList.findObject() in fetchAssociatedExperience" << LL_ENDL;
+ LL_DEBUGS() << "Using gAgent.getRegion() instead of object->getRegion()" << LL_ENDL;
+ }
+ LLViewerRegion* region = NULL;
+ if (object)
+ {
+ region = object->getRegion();
+ }
+ else
+ {
+ region = gAgent.getRegion();
+ }
if (region)
{
std::string lookup_url=region->getCapability("GetMetadata");
@@ -59,6 +74,10 @@ void ExperienceAssociationResponder::fetchAssociatedExperience(LLSD& request, ca
LLHTTPClient::post(lookup_url, request, new ExperienceAssociationResponder(callback));
}
}
+ else
+ {
+ LL_WARNS() << "Failed to lookup region in fetchAssociatedExperience. Fetch request not sent." << LL_ENDL;
+ }
}
void ExperienceAssociationResponder::httpFailure()