can't set item's value to null if the item is new.
authorAlon Gazit <alon@mono-cvs.ximian.com>
Mon, 5 Jan 2004 12:54:53 +0000 (12:54 -0000)
committerAlon Gazit <alon@mono-cvs.ximian.com>
Mon, 5 Jan 2004 12:54:53 +0000 (12:54 -0000)
svn path=/trunk/mcs/; revision=21712

mcs/class/System.Web/System.Web.SessionState/ChangeLog
mcs/class/System.Web/System.Web.SessionState/SessionDictionary.cs

index c78a61a3dc21233dadc2d638e9519edc9f9f6e97..769c9593fef9ab0856a15bdbc22ffcc4d6bbf9e4 100644 (file)
@@ -1,3 +1,7 @@
+2004-01-05  Alon Gazit <along@mainsoft.com>
+
+       * SessionDictionary.cs: can't set item's value to null if the item is new.
+
 2003-12-25  Jackson Harper <jackson@ximian.com>
 
        * SessionStateModule.cs: Handle SessionStateMode.Off properly in
index 957b323128349447e8c8a44782eb7c0f8b691e3d..d610569a576b4bdae81373ac7f110f42593bc32d 100644 (file)
@@ -106,8 +106,13 @@ internal class SessionDictionary : NameObjectCollectionBase
                }
 
                set {
-                       lock (this)
+                       lock (this)\r
+                       {                                \r
+                               object obj = BaseGet(s);\r
+                               if ((obj == null) && (value == null))\r
+                                       return; \r
                                BaseSet (s, value);
+                       }
 
                        _dirty = true;
                }
@@ -124,7 +129,12 @@ internal class SessionDictionary : NameObjectCollectionBase
                }
                set {
                        lock (this)
+                       {                                \r
+                               object obj = BaseGet(index);\r
+                               if ((obj == null) && (value == null))\r
+                                       return; \r
                                BaseSet (index, value);
+                       }
 
                        _dirty = true;
                }