From eb5a95d26bca4840f5a082156c0a37afed166fb1 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 18 May 2010 03:02:36 +0200 Subject: Prevent an "index out of range" error on login --- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 5339dee..30eb9b8 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -454,9 +454,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private void StatusNotifyMass(List friendList, UUID userID, bool online) { - string[] friendIDs = new string[friendList.Count]; + int fct = friendList.Count; + string[] friendIDs = new string[fct]; int notlocal = 0; - for (int x = 0; x < friendList.Count; x++) + for (int x = 0 ; x < fct ; x++) { UUID friendID = UUID.Zero; if (UUID.TryParse(friendList[x].Friend, out friendID)) @@ -472,6 +473,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends for (int x = 0; x < friendSessions.GetLength(0); x++) { + if (friendIDs.Length <= x) + continue; PresenceInfo friendSession = friendSessions[x]; if (friendSession != null) { -- cgit v1.1