summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-15 17:39:15 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-15 17:39:15 +0000
commit1ce4089fe75ad721f0992723defc64b18e1b7bd4 (patch)
tree1f0685342c2c8965d943e4732666dd3125e8820e /indra/newview
parentfecaf7b64fdc3d9ebf1d32ddb1ed8b50904db534 (diff)
CID-133
Checker: NULL_RETURNS Function: is_agent_mappable(const LLUUID &) File: /indra/newview/llviewermenu.cpp
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewermenu.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8c61ba7558..9565ae6150 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -3554,9 +3554,15 @@ bool LLHaveCallingcard::operator()(LLInventoryCategory* cat,
BOOL is_agent_mappable(const LLUUID& agent_id)
{
- return (LLAvatarActions::isFriend(agent_id) &&
- LLAvatarTracker::instance().getBuddyInfo(agent_id)->isOnline() &&
- LLAvatarTracker::instance().getBuddyInfo(agent_id)->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)
+ LLRelationship* buddy_info = NULL;
+ bool is_friend = LLAvatarActions::isFriend(agent_id);
+
+ if (is_friend)
+ buddy_info = LLAvatarTracker::instance().getBuddyInfo(agent_id);
+
+ return (buddy_info &&
+ buddy_info->isOnline() &&
+ buddy_info->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)
);
}