Skip to content

Commit

Permalink
Check HttpContext.Server.Current not null.
Browse files Browse the repository at this point in the history
Possibly using MiniProfiler in framework/shared code that can be
used outside of IIS.
  • Loading branch information
c17r committed Jul 13, 2012
1 parent c98a7c9 commit 6da82d9
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 6da82d9

Please sign in to comment.