Skip to content

Commit

Permalink
Merge pull request #51 from sauerc/template-error
Browse files Browse the repository at this point in the history
Check HttpContext.Server.Current not null.
  • Loading branch information
SamSaffron committed Jul 16, 2012
2 parents 0c2dcb0 + 6da82d9 commit 2c2e409
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion StackExchange.Profiling/MiniProfiler.Settings.cs
Expand Up @@ -49,7 +49,9 @@ where p.IsDefined(t, inherit: false)
List<string> files = new List<string>();
files.Add(location);

string customUITemplatesPath = HttpContext.Current.Server.MapPath(MiniProfiler.Settings.CustomUITemplates);
string customUITemplatesPath = "";
if (HttpContext.Current != null)
customUITemplatesPath = HttpContext.Current.Server.MapPath(MiniProfiler.Settings.CustomUITemplates);

if (System.IO.Directory.Exists(customUITemplatesPath))
{
Expand Down

0 comments on commit 2c2e409

Please sign in to comment.