From: Marek Habersack Date: Wed, 12 May 2010 11:10:03 +0000 (-0000) Subject: 2010-05-12 Marek Habersack X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=f22981278878c92cf0ab8eeae417a754df076cf8;p=mono.git 2010-05-12 Marek Habersack * HttpServerUtility.cs: Execute checks whether IAsyncResult.AsyncWaitHandle is not null before attempting to use it. Fixes bug #604502 svn path=/trunk/mcs/; revision=157221 --- diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog index 0054dd5eab7..f7e2597d38d 100644 --- a/mcs/class/System.Web/System.Web/ChangeLog +++ b/mcs/class/System.Web/System.Web/ChangeLog @@ -1,3 +1,9 @@ +2010-05-12 Marek Habersack + + * HttpServerUtility.cs: Execute checks whether + IAsyncResult.AsyncWaitHandle is not null before attempting to use + it. Fixes bug #604502 + 2010-05-06 Marek Habersack * PreApplicationStartMethodAttribute.cs: added. New 4.0 type. diff --git a/mcs/class/System.Web/System.Web/HttpServerUtility.cs b/mcs/class/System.Web/System.Web/HttpServerUtility.cs index a5e8ff265df..58b5caeee32 100644 --- a/mcs/class/System.Web/System.Web/HttpServerUtility.cs +++ b/mcs/class/System.Web/System.Web/HttpServerUtility.cs @@ -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 {