aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-14 16:06:06 +0000
committerJustin Clark-Casey (justincc)2011-11-14 16:06:06 +0000
commitff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e (patch)
tree236dd34deb3a8cc1259dcd37a51f5f88d8d79a22 /OpenSim/Region/CoreModules
parentDo a ScenePresence null check in HGMessageTransferModule.SendIMToScene() to s... (diff)
downloadopensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.zip
opensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.tar.gz
opensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.tar.bz2
opensim-SC_OLD-ff36a1bc7bcd1d0fe5aecb4c5358dbb072c7ff6e.tar.xz
If a friends identifier which is too short is given to HGFriendsModule.GetOnlineFriends() then spit out a warning rather than failing on the String.Substring().
This is to progress http://opensimulator.org/mantis/view.php?id=5789
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
index dda67f9..02b417f 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs
@@ -141,7 +141,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
141 { 141 {
142 List<string> fList = new List<string>(); 142 List<string> fList = new List<string>();
143 foreach (string s in friendList) 143 foreach (string s in friendList)
144 fList.Add(s.Substring(0, 36)); 144 {
145 if (s.Length < 36)
146 m_log.WarnFormat(
147 "[HGFRIENDS MODULE]: Ignoring friend {0} ({1} chars) for {2} since identifier too short",
148 s, s.Length, userID);
149 else
150 fList.Add(s.Substring(0, 36));
151 }
145 152
146 PresenceInfo[] presence = PresenceService.GetAgents(fList.ToArray()); 153 PresenceInfo[] presence = PresenceService.GetAgents(fList.ToArray());
147 foreach (PresenceInfo pi in presence) 154 foreach (PresenceInfo pi in presence)