mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
avoid a null ref on hg useragentservice
This commit is contained in:
@@ -644,19 +644,21 @@ namespace OpenSim.Services.HypergridService
|
||||
return targetUserID.ToString() + ";" + m_GridName + ";" + account.FirstName + " " + account.LastName ;
|
||||
|
||||
// Let's try the list of friends
|
||||
FriendInfo[] friends = m_FriendsService.GetFriends(userID);
|
||||
if (friends != null && friends.Length > 0)
|
||||
if(m_FriendsService != null)
|
||||
{
|
||||
foreach (FriendInfo f in friends)
|
||||
if (f.Friend.StartsWith(targetUserID.ToString()))
|
||||
{
|
||||
// Let's remove the secret
|
||||
UUID id; string tmp = string.Empty, secret = string.Empty;
|
||||
if (Util.ParseUniversalUserIdentifier(f.Friend, out id, out tmp, out tmp, out tmp, out secret))
|
||||
return f.Friend.Replace(secret, "0");
|
||||
}
|
||||
FriendInfo[] friends = m_FriendsService.GetFriends(userID);
|
||||
if (friends != null && friends.Length > 0)
|
||||
{
|
||||
foreach (FriendInfo f in friends)
|
||||
if (f.Friend.StartsWith(targetUserID.ToString()))
|
||||
{
|
||||
// Let's remove the secret
|
||||
UUID id; string tmp = string.Empty, secret = string.Empty;
|
||||
if (Util.ParseUniversalUserIdentifier(f.Friend, out id, out tmp, out tmp, out tmp, out secret))
|
||||
return f.Friend.Replace(secret, "0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user