From aad0870e29ae9c98a400721b16f974dc9496892e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 19 Dec 2017 09:49:51 +0100 Subject: [PATCH] Fix possible crash in FSCommon::applyDefaultBuildPreferences() --- indra/newview/fscommon.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index 222a147d7f..b4a1fbfd58 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -163,7 +163,7 @@ S32 FSCommon::secondsSinceEpochFromString(const std::string& format, const std:: void FSCommon::applyDefaultBuildPreferences(LLViewerObject* object) { - if (!object) + if (!object || !object->getRegion()) { return; } @@ -234,8 +234,8 @@ void FSCommon::applyDefaultBuildPreferences(LLViewerObject* object) { gMessageSystem->newMessageFast(_PREHASH_ObjectPermissions); gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgentID); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); gMessageSystem->nextBlockFast(_PREHASH_HeaderData); gMessageSystem->addBOOLFast(_PREHASH_Override, (BOOL)FALSE); gMessageSystem->nextBlockFast(_PREHASH_ObjectData); @@ -258,13 +258,13 @@ void FSCommon::applyDefaultBuildPreferences(LLViewerObject* object) gMessageSystem->newMessage(_PREHASH_ObjectFlagUpdate); gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgentID); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, object_local_id); gMessageSystem->addBOOLFast(_PREHASH_UsePhysics, gSavedSettings.getBOOL("FSBuildPrefs_Physical")); gMessageSystem->addBOOL(_PREHASH_IsTemporary, gSavedSettings.getBOOL("FSBuildPrefs_Temporary")); gMessageSystem->addBOOL(_PREHASH_IsPhantom, gSavedSettings.getBOOL("FSBuildPrefs_Phantom")); - gMessageSystem->addBOOL("CastsShadows", FALSE ); + gMessageSystem->addBOOL("CastsShadows", FALSE); gMessageSystem->sendReliable(object->getRegion()->getHost()); }