Fix issue: null references when looking up friend on home grid (not HG

friend)


git-svn-id: http://forge.opensimulator.org/svn/osprofile/trunk@100 19860011-0018-435d-96ae-4a7b0aaa3128
This commit is contained in:
bluewall
2012-01-15 23:51:46 +00:00
parent 19e06216ad
commit 17121d258e
2 changed files with 22 additions and 1 deletions
@@ -693,6 +693,17 @@ namespace OpenSimProfile.Modules.OpenProfile
string serverURI = string.Empty;
bool foreign = GetUserProfileServerURI(userID, out serverURI);
// This is checking a friend on the home grid
// Not HG friend
if ( String.IsNullOrEmpty(serverURI))
{
Hashtable nop =new Hashtable();
nop["success"] = "false";
nop["errorMessage"] = "No Presence - foreign friend";
return nop;
}
Hashtable result = GenericXMLRPCRequest(ReqHash,
"avatar_properties_request", serverURI);
@@ -757,7 +768,6 @@ namespace OpenSimProfile.Modules.OpenProfile
born = Util.ToDateTime(account.Created).ToString(
"M/d/yyyy", CultureInfo.InvariantCulture);
flags = (uint)(account.UserFlags & 0xff);
}
else
{
@@ -895,6 +905,17 @@ namespace OpenSimProfile.Modules.OpenProfile
{
// Is Foreign
string home_url = uManage.GetUserServerURL(userID, "HomeURI");
if (String.IsNullOrEmpty(home_url))
{
info["user_flags"] = 0;
info["user_created"] = 0;
info["user_title"] = "Unavailable";
userInfo = info;
return true;
}
UserAgentServiceConnector uConn = new UserAgentServiceConnector(home_url);
Dictionary<string, object> account = uConn.GetUserInfo(userID);
Binary file not shown.