[asp.net] HttpRuntime.AppDomainAppPath may be null during tests, check it before...
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / WebConfigurationManager.cs
index 4f7092115fdfae06ed7c34d0c5f3b2d8a45c2bd5..27ae1e7784e58ed522b88ba0b407009e6230c352 100644 (file)
@@ -586,8 +586,9 @@ namespace System.Web.Configuration {
                        HttpContext ctx = HttpContext.Current;
                        HttpRequest req = ctx != null ? ctx.Request : null;
                        string physPath = req != null ? VirtualPathUtility.AppendTrailingSlash (MapPath (req, path)) : null;
+                       string appDomainPath = HttpRuntime.AppDomainAppPath;
                        
-                       if (physPath != null && !physPath.StartsWith (HttpRuntime.AppDomainAppPath, StringComparison.Ordinal))
+                       if (physPath != null && appDomainPath != null && !physPath.StartsWith (appDomainPath, StringComparison.Ordinal))
                                inAnotherApp = true;
                        
                        string dir;