From d1bb73d068077c7ca884fa5d326bbfb5ec5b850b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Feb 2014 19:17:21 +0000 Subject: In core.groups GroupsServiceRemoveConnector, if GetGroupRecord() or UpdateGroup() do not have a RESULT parameter in the result message, return null rather than fail with NullReferenceException This check was already done by other methods. Looks to resolve http://opensimulator.org/mantis/view.php?id=7012 --- OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'OpenSim/Addons') diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs index ed41978..67402a2 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs @@ -106,7 +106,7 @@ namespace OpenSim.Groups sendData["OP"] = "UPDATE"; Dictionary ret = MakeRequest("PUTGROUP", sendData); - if (ret == null || (ret != null && ret["RESULT"].ToString() == "NULL")) + if (ret == null || (ret != null && (!ret.ContainsKey("RESULT") || ret["RESULT"].ToString() == "NULL"))) return null; return GroupsDataUtils.GroupRecord((Dictionary)ret["RESULT"]); @@ -127,7 +127,7 @@ namespace OpenSim.Groups Dictionary ret = MakeRequest("GETGROUP", sendData); - if (ret == null || (ret != null && ret["RESULT"].ToString() == "NULL")) + if (ret == null || (ret != null && (!ret.ContainsKey("RESULT") || ret["RESULT"].ToString() == "NULL"))) return null; return GroupsDataUtils.GroupRecord((Dictionary)ret["RESULT"]); @@ -267,6 +267,7 @@ namespace OpenSim.Groups if (ret["RESULT"].ToString() == "NULL") return members; + foreach (object v in ((Dictionary)ret["RESULT"]).Values) { ExtendedGroupMembersData m = GroupsDataUtils.GroupMembersData((Dictionary)v); @@ -357,6 +358,7 @@ namespace OpenSim.Groups if (ret["RESULT"].ToString() == "NULL") return roles; + foreach (object v in ((Dictionary)ret["RESULT"]).Values) { GroupRolesData m = GroupsDataUtils.GroupRolesData((Dictionary)v); @@ -667,7 +669,7 @@ namespace OpenSim.Groups return replyData; } - #endregion + #endregion } -} +} \ No newline at end of file -- cgit v1.1