Author: mhabersack
Date: 2008-02-18 12:01:53 -0500 (Mon, 18 Feb 2008)
New Revision: 96079

Modified:
   trunk/mcs/class/System.Web/System.Web.Hosting/ChangeLog
   trunk/mcs/class/System.Web/System.Web.Hosting/VirtualPathProvider.cs
Log:
2008-02-18  Marek Habersack  <[EMAIL PROTECTED]>

        * VirtualPathProvider.cs: chain up to the previous provider, if
        prexent. Fixes bug #362038


Modified: trunk/mcs/class/System.Web/System.Web.Hosting/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Hosting/ChangeLog     2008-02-18 
16:55:13 UTC (rev 96078)
+++ trunk/mcs/class/System.Web/System.Web.Hosting/ChangeLog     2008-02-18 
17:01:53 UTC (rev 96079)
@@ -1,3 +1,8 @@
+2008-02-18  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * VirtualPathProvider.cs: chain up to the previous provider, if
+       prexent. Fixes bug #362038
+
 2008-01-06  Marek Habersack  <[EMAIL PROTECTED]>
 
        * ApplicationHost.cs: make sure that application with virtualDir

Modified: trunk/mcs/class/System.Web/System.Web.Hosting/VirtualPathProvider.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.Hosting/VirtualPathProvider.cs        
2008-02-18 16:55:13 UTC (rev 96078)
+++ trunk/mcs/class/System.Web/System.Web.Hosting/VirtualPathProvider.cs        
2008-02-18 17:01:53 UTC (rev 96079)
@@ -63,38 +63,57 @@
 
                public virtual bool DirectoryExists (string virtualDir)
                {
+                       if (prev != null)
+                               return prev.DirectoryExists (virtualDir);
+                       
                        return false;
                }
 
                public virtual bool FileExists (string virtualPath)
                {
+                       if (prev != null)
+                               return FileExists (virtualPath);
+                       
                        return false;
                }
 
-               public virtual CacheDependency GetCacheDependency (string 
virtualPath,
-                                                               IEnumerable 
virtualPathDependencies,
-                                                               DateTime 
utcStart)
+               public virtual CacheDependency GetCacheDependency (string 
virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
                {
+                       if (prev != null)
+                               return prev.GetCacheDependency (virtualPath, 
virtualPathDependencies, utcStart);
+                       
                        return null;
                }
 
                public virtual string GetCacheKey (string virtualPath)
                {
+                       if (prev != null)
+                               return prev.GetCacheKey (virtualPath);
+                       
                        return null;
                }
 
                public virtual VirtualDirectory GetDirectory (string virtualDir)
                {
+                       if (prev != null)
+                               return prev.GetDirectory (virtualDir);
+                       
                        return null;
                }
 
                public virtual VirtualFile GetFile (string virtualPath)
                {
+                       if (prev != null)
+                               return prev.GetFile (virtualPath);
+                       
                        return null;
                }
 
                public virtual string GetFileHash (string virtualPath, 
IEnumerable virtualPathDependencies)
                {
+                       if (prev != null)
+                               return prev.GetFileHash (virtualPath, 
virtualPathDependencies);
+                       
                        return null;
                }
 
@@ -108,7 +127,10 @@
                        // This thing throws a nullref when we're not inside an 
ASP.NET appdomain, which is what MS does.
                        VirtualPathProvider provider = 
HostingEnvironment.VirtualPathProvider;
                        VirtualFile file = provider.GetFile (virtualPath);
-                       return file.Open ();
+                       if (file != null)
+                               return file.Open ();
+
+                       return null;
                }
        }
 }

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to