diff options
author | Michael Cortez | 2009-10-05 12:09:45 -0700 |
---|---|---|
committer | Melanie | 2009-10-05 20:52:07 +0100 |
commit | f4726f4bccec614065e0f10f8b51bb7317d4a680 (patch) | |
tree | a09b460e343cd748671b71ea438ea6f24b3d0fdd | |
parent | Ensure the specified imSessionID exists in the DroppedSession collection befo... (diff) | |
download | opensim-SC-f4726f4bccec614065e0f10f8b51bb7317d4a680.zip opensim-SC-f4726f4bccec614065e0f10f8b51bb7317d4a680.tar.gz opensim-SC-f4726f4bccec614065e0f10f8b51bb7317d4a680.tar.bz2 opensim-SC-f4726f4bccec614065e0f10f8b51bb7317d4a680.tar.xz |
Make sure that keys exist in arrays before trying to access them.
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 2e89a24..b209199 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -148,9 +148,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
148 | UUID[] CurrentKeys = new UUID[m_clientRequestIDInfo.Count]; | 148 | UUID[] CurrentKeys = new UUID[m_clientRequestIDInfo.Count]; |
149 | foreach (UUID key in CurrentKeys) | 149 | foreach (UUID key in CurrentKeys) |
150 | { | 150 | { |
151 | if (DateTime.Now - m_clientRequestIDInfo[key].LastUsedTMStamp > cacheTimeout) | 151 | if (m_clientRequestIDInfo.ContainsKey(key)) |
152 | { | 152 | { |
153 | m_clientRequestIDInfo.Remove(key); | 153 | if (DateTime.Now - m_clientRequestIDInfo[key].LastUsedTMStamp > cacheTimeout) |
154 | { | ||
155 | m_clientRequestIDInfo.Remove(key); | ||
156 | } | ||
154 | } | 157 | } |
155 | } | 158 | } |
156 | } | 159 | } |
@@ -476,7 +479,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
476 | 479 | ||
477 | foreach (string key in binBucketOSD.Keys) | 480 | foreach (string key in binBucketOSD.Keys) |
478 | { | 481 | { |
479 | m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString()); | 482 | if (binBucketOSD.ContainsKey(key)) |
483 | { | ||
484 | m_log.WarnFormat("{0}: {1}", key, binBucketOSD[key].ToString()); | ||
485 | } | ||
480 | } | 486 | } |
481 | } | 487 | } |
482 | 488 | ||