Skip to content

Commit

Permalink
Added AcceptTypes null check to PartialViewResultFormatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
benfoster committed Mar 6, 2013
1 parent c8184d8 commit 0d5e04c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Fabrik.Common.Web/PartialViewResultFormatter.cs
Expand Up @@ -18,7 +18,9 @@ public PartialViewResultFormatter(string partialViewPrefix = "_", string viewOve

public virtual bool IsSatisfiedBy(ControllerContext controllerContext)
{
return controllerContext.HttpContext.Request.AcceptTypes.Contains("text/html")
var acceptTypes = controllerContext.HttpContext.Request.AcceptTypes ?? new string[0];

return acceptTypes.Contains("text/html")
&& (controllerContext.HttpContext.Request.IsAjaxRequest() || controllerContext.IsChildAction);
}

Expand Down

0 comments on commit 0d5e04c

Please sign in to comment.