From 446934322cdde8dc5f95f080b8679e08501dd0ae Mon Sep 17 00:00:00 2001 From: Dario Solera Date: Thu, 14 Jan 2010 06:34:04 +0000 Subject: [PATCH] Fixed and closed #438: group deletion no longer causes exceptions for former members. --- AssemblyVersion.cs | 4 ++-- Core/SessionFacade.cs | 9 ++++++--- Core/UsersStorageProvider.cs | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index 8e9195d..9431da0 100644 --- a/AssemblyVersion.cs +++ b/AssemblyVersion.cs @@ -16,5 +16,5 @@ using System.Reflection; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.0.1.455")] -[assembly: AssemblyFileVersion("3.0.1.455")] +[assembly: AssemblyVersion("3.0.1.456")] +[assembly: AssemblyFileVersion("3.0.1.456")] diff --git a/Core/SessionFacade.cs b/Core/SessionFacade.cs index a5a86e6..0a3e94e 100644 --- a/Core/SessionFacade.cs +++ b/Core/SessionFacade.cs @@ -94,10 +94,13 @@ namespace ScrewTurn.Wiki { if(groups == null || groups.Length == 0) { UserInfo current = GetCurrentUser(); if(current != null) { - groups = new UserGroup[current.Groups.Length]; - for(int i = 0; i < groups.Length; i++) { - groups[i] = Users.FindUserGroup(current.Groups[i]); + // This check is necessary because after group deletion the session might contain outdated data + List temp = new List(current.Groups.Length); + for(int i = 0; i < current.Groups.Length; i++) { + UserGroup tempGroup = Users.FindUserGroup(current.Groups[i]); + if(tempGroup != null) temp.Add(tempGroup); } + groups = temp.ToArray(); } else { groups = new UserGroup[] { Users.FindUserGroup(Settings.AnonymousGroup) }; diff --git a/Core/UsersStorageProvider.cs b/Core/UsersStorageProvider.cs index 0521411..3dac62b 100644 --- a/Core/UsersStorageProvider.cs +++ b/Core/UsersStorageProvider.cs @@ -643,6 +643,7 @@ namespace ScrewTurn.Wiki { DumpUserGroups(result.ToArray()); groupsCache = null; + usersCache = null; return result.Count == allGroups.Length - 1; }