diff options
author | Justin Clark-Casey (justincc) | 2014-02-20 19:17:21 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-02-20 19:17:21 +0000 |
commit | d1bb73d068077c7ca884fa5d326bbfb5ec5b850b (patch) | |
tree | 45db25683f209917b7ab9116a147adf5f2ae1db1 | |
parent | For now, do not replacing missing wearables with default wearables if itme de... (diff) | |
download | opensim-SC_OLD-d1bb73d068077c7ca884fa5d326bbfb5ec5b850b.zip opensim-SC_OLD-d1bb73d068077c7ca884fa5d326bbfb5ec5b850b.tar.gz opensim-SC_OLD-d1bb73d068077c7ca884fa5d326bbfb5ec5b850b.tar.bz2 opensim-SC_OLD-d1bb73d068077c7ca884fa5d326bbfb5ec5b850b.tar.xz |
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
-rw-r--r-- | OpenSim/Addons/Groups/Remote/GroupsServiceRemoteConnector.cs | 10 |
1 files changed, 6 insertions, 4 deletions
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 | |||
106 | sendData["OP"] = "UPDATE"; | 106 | sendData["OP"] = "UPDATE"; |
107 | Dictionary<string, object> ret = MakeRequest("PUTGROUP", sendData); | 107 | Dictionary<string, object> ret = MakeRequest("PUTGROUP", sendData); |
108 | 108 | ||
109 | if (ret == null || (ret != null && ret["RESULT"].ToString() == "NULL")) | 109 | if (ret == null || (ret != null && (!ret.ContainsKey("RESULT") || ret["RESULT"].ToString() == "NULL"))) |
110 | return null; | 110 | return null; |
111 | 111 | ||
112 | return GroupsDataUtils.GroupRecord((Dictionary<string, object>)ret["RESULT"]); | 112 | return GroupsDataUtils.GroupRecord((Dictionary<string, object>)ret["RESULT"]); |
@@ -127,7 +127,7 @@ namespace OpenSim.Groups | |||
127 | 127 | ||
128 | Dictionary<string, object> ret = MakeRequest("GETGROUP", sendData); | 128 | Dictionary<string, object> ret = MakeRequest("GETGROUP", sendData); |
129 | 129 | ||
130 | if (ret == null || (ret != null && ret["RESULT"].ToString() == "NULL")) | 130 | if (ret == null || (ret != null && (!ret.ContainsKey("RESULT") || ret["RESULT"].ToString() == "NULL"))) |
131 | return null; | 131 | return null; |
132 | 132 | ||
133 | return GroupsDataUtils.GroupRecord((Dictionary<string, object>)ret["RESULT"]); | 133 | return GroupsDataUtils.GroupRecord((Dictionary<string, object>)ret["RESULT"]); |
@@ -267,6 +267,7 @@ namespace OpenSim.Groups | |||
267 | 267 | ||
268 | if (ret["RESULT"].ToString() == "NULL") | 268 | if (ret["RESULT"].ToString() == "NULL") |
269 | return members; | 269 | return members; |
270 | |||
270 | foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values) | 271 | foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values) |
271 | { | 272 | { |
272 | ExtendedGroupMembersData m = GroupsDataUtils.GroupMembersData((Dictionary<string, object>)v); | 273 | ExtendedGroupMembersData m = GroupsDataUtils.GroupMembersData((Dictionary<string, object>)v); |
@@ -357,6 +358,7 @@ namespace OpenSim.Groups | |||
357 | 358 | ||
358 | if (ret["RESULT"].ToString() == "NULL") | 359 | if (ret["RESULT"].ToString() == "NULL") |
359 | return roles; | 360 | return roles; |
361 | |||
360 | foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values) | 362 | foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values) |
361 | { | 363 | { |
362 | GroupRolesData m = GroupsDataUtils.GroupRolesData((Dictionary<string, object>)v); | 364 | GroupRolesData m = GroupsDataUtils.GroupRolesData((Dictionary<string, object>)v); |
@@ -667,7 +669,7 @@ namespace OpenSim.Groups | |||
667 | 669 | ||
668 | return replyData; | 670 | return replyData; |
669 | } | 671 | } |
670 | #endregion | ||
671 | 672 | ||
673 | #endregion | ||
672 | } | 674 | } |
673 | } | 675 | } \ No newline at end of file |