2010-05-12 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Wed, 12 May 2010 11:10:03 +0000 (11:10 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 12 May 2010 11:10:03 +0000 (11:10 -0000)
* HttpServerUtility.cs: Execute checks whether
IAsyncResult.AsyncWaitHandle is not null before attempting to use
it. Fixes bug #604502

svn path=/trunk/mcs/; revision=157221

mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpServerUtility.cs

index 0054dd5eab762b31ae925b4e3c5a215cddf501c4..f7e2597d38d37760903cf39f9029e8929ba4007e 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-12  Marek Habersack  <mhabersack@novell.com>
+
+       * HttpServerUtility.cs: Execute checks whether
+       IAsyncResult.AsyncWaitHandle is not null before attempting to use
+       it. Fixes bug #604502
+
 2010-05-06  Marek Habersack  <mhabersack@novell.com>
 
        * PreApplicationStartMethodAttribute.cs: added. New 4.0 type.
index a5e8ff265dfdd4c17d0d6c63de6bedca627c8bd6..58b5caeee32c92461ed37e99be82e73eef09a71a 100644 (file)
@@ -36,6 +36,7 @@ using System.Web.Util;
 using System.Collections.Specialized;
 using System.Security.Permissions;
 using System.Text;
+using System.Threading;
 using System.Web.Configuration;
 using System.Web.SessionState;
 
@@ -169,7 +170,9 @@ namespace System.Web
                                } else {
                                        IHttpAsyncHandler asyncHandler = (IHttpAsyncHandler) handler;
                                        IAsyncResult ar = asyncHandler.BeginProcessRequest (context, null, null);
-                                       ar.AsyncWaitHandle.WaitOne ();
+                                       WaitHandle asyncWaitHandle = ar != null ? ar.AsyncWaitHandle : null;
+                                       if (asyncWaitHandle != null)
+                                               asyncWaitHandle.WaitOne ();
                                        asyncHandler.EndProcessRequest (ar);
                                }
                        } finally {