Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added AcceptTypes null check to PartialViewResultFormatter.

  • Loading branch information...
commit 0d5e04cf3276d760df4488de74b4065cdc5142a0 1 parent c8184d8
@benfoster authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Fabrik.Common.Web/PartialViewResultFormatter.cs
View
4 src/Fabrik.Common.Web/PartialViewResultFormatter.cs
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.