mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
avoid a possible null ref; cosmetics
This commit is contained in:
@@ -491,7 +491,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
foreach (Scene scene in m_Scenes)
|
||||
{
|
||||
ScenePresence presence = scene.GetScenePresence(agentID);
|
||||
if (presence != null && !presence.IsChildAgent)
|
||||
if (presence != null && !presence.IsDeleted && !presence.IsChildAgent)
|
||||
return presence.ControllingClient;
|
||||
}
|
||||
}
|
||||
@@ -627,8 +627,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
if (friendSession != null)
|
||||
{
|
||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||
m_FriendsSimConnector.FriendshipOffered(region, agentID, friendID, im.message);
|
||||
return true;
|
||||
if(region != null)
|
||||
{
|
||||
m_FriendsSimConnector.FriendshipOffered(region, agentID, friendID, im.message);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If the prospective friend is not online, he'll get the message upon login.
|
||||
|
||||
@@ -776,7 +776,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
if (!m_uMan.IsLocalGridUser(friendID))
|
||||
{
|
||||
string friendsURL = m_uMan.GetUserServerURL(friendID, "FriendsServerURI");
|
||||
if (friendsURL != string.Empty)
|
||||
if (!string.IsNullOrEmpty(friendsURL))
|
||||
{
|
||||
m_log.DebugFormat("[HGFRIENDS MODULE]: Forwading friendship from {0} to {1} @ {2}", agentID, friendID, friendsURL);
|
||||
GridRegion region = new GridRegion();
|
||||
|
||||
Reference in New Issue
Block a user