Skip to content

Commit

Permalink
umbraco#9964 Removed unneeded check for HttpContext
Browse files Browse the repository at this point in the history
  • Loading branch information
markusobviuse committed Mar 15, 2021
1 parent b7c1ad2 commit 671ebf9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Umbraco.Core/IO/IOHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public static Attempt<string> TryResolveUrl(string virtualPath)
public static string MapPath(string path, bool useHttpContext)
{
if (path == null) throw new ArgumentNullException("path");

useHttpContext = useHttpContext && IsHosted;

// Check if the path is already mapped
Expand All @@ -89,10 +90,8 @@ public static string MapPath(string path, bool useHttpContext)
{
return path;
}
// Check that we even have an HttpContext! otherwise things will fail anyways
// http://umbraco.codeplex.com/workitem/30946

if (useHttpContext && HttpContext.Current != null)
if (useHttpContext)
{
//string retval;
if (String.IsNullOrEmpty(path) == false && (path.StartsWith("~") || path.StartsWith(SystemDirectories.Root)))
Expand Down

0 comments on commit 671ebf9

Please sign in to comment.