diff options
author | Melanie Thielker | 2010-05-18 03:02:36 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-05-18 03:02:36 +0200 |
commit | eb5a95d26bca4840f5a082156c0a37afed166fb1 (patch) | |
tree | 442e3b5a428d1b647fe77bacd5d003a99173c6cd /OpenSim/Region/CoreModules/Avatar | |
parent | Following on from the last commit, the stop/disconnect packet should NOT be s... (diff) | |
download | opensim-SC_OLD-eb5a95d26bca4840f5a082156c0a37afed166fb1.zip opensim-SC_OLD-eb5a95d26bca4840f5a082156c0a37afed166fb1.tar.gz opensim-SC_OLD-eb5a95d26bca4840f5a082156c0a37afed166fb1.tar.bz2 opensim-SC_OLD-eb5a95d26bca4840f5a082156c0a37afed166fb1.tar.xz |
Prevent an "index out of range" error on login
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 7 |
1 files changed, 5 insertions, 2 deletions
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 | |||
454 | 454 | ||
455 | private void StatusNotifyMass(List<FriendInfo> friendList, UUID userID, bool online) | 455 | private void StatusNotifyMass(List<FriendInfo> friendList, UUID userID, bool online) |
456 | { | 456 | { |
457 | string[] friendIDs = new string[friendList.Count]; | 457 | int fct = friendList.Count; |
458 | string[] friendIDs = new string[fct]; | ||
458 | int notlocal = 0; | 459 | int notlocal = 0; |
459 | for (int x = 0; x < friendList.Count; x++) | 460 | for (int x = 0 ; x < fct ; x++) |
460 | { | 461 | { |
461 | UUID friendID = UUID.Zero; | 462 | UUID friendID = UUID.Zero; |
462 | if (UUID.TryParse(friendList[x].Friend, out friendID)) | 463 | if (UUID.TryParse(friendList[x].Friend, out friendID)) |
@@ -472,6 +473,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
472 | 473 | ||
473 | for (int x = 0; x < friendSessions.GetLength(0); x++) | 474 | for (int x = 0; x < friendSessions.GetLength(0); x++) |
474 | { | 475 | { |
476 | if (friendIDs.Length <= x) | ||
477 | continue; | ||
475 | PresenceInfo friendSession = friendSessions[x]; | 478 | PresenceInfo friendSession = friendSessions[x]; |
476 | if (friendSession != null) | 479 | if (friendSession != null) |
477 | { | 480 | { |