diff options
author | Michael Cortez | 2009-10-05 12:09:45 -0700 |
---|---|---|
committer | Melanie | 2009-10-05 20:47:00 +0100 |
commit | d4a6d9191a3ba4f19773213617843ddbb489c90c (patch) | |
tree | 43abab9ebc97e022fafcdf5f0acf643a0aea3ea3 /OpenSim/Region | |
parent | Ensure the specified imSessionID exists in the DroppedSession collection befo... (diff) | |
download | opensim-SC_OLD-d4a6d9191a3ba4f19773213617843ddbb489c90c.zip opensim-SC_OLD-d4a6d9191a3ba4f19773213617843ddbb489c90c.tar.gz opensim-SC_OLD-d4a6d9191a3ba4f19773213617843ddbb489c90c.tar.bz2 opensim-SC_OLD-d4a6d9191a3ba4f19773213617843ddbb489c90c.tar.xz |
Make sure that keys exist in arrays before trying to access them.
Diffstat (limited to 'OpenSim/Region')
-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 | ||