Skip to content

Commit

Permalink
Merge pull request #19 from brutaldev/master
Browse files Browse the repository at this point in the history
Fix for issue #16
  • Loading branch information
rdingwall committed Jun 28, 2015
2 parents 7109406 + a380fa6 commit c86c272
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Elmah.Contrib.WebApi/ElmahExceptionLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ private static HttpContext GetHttpContext(HttpRequestMessage request)
return null;

object value;
if (!request.Properties.TryGetValue("MS_HttpContext", out value))
return null;

HttpContextBase context = value as HttpContextBase;
if (context == null)
return null;

return context.ApplicationInstance.Context;
if (request.Properties.TryGetValue("MS_HttpContext", out value))
{
HttpContextBase context = value as HttpContextBase;
if (context != null)
return context.ApplicationInstance.Context;
}

return HttpContext.Current;
}
}
}
Expand Down

0 comments on commit c86c272

Please sign in to comment.