Error in AntiForgeryAuthorizationFilter

Topics: Administration, Core, Customizing Orchard, General
Dec 22, 2015 at 10:16 AM
Whenever I try to update the theme settings, for example:

Dashboard > Themes > Base Settings > Color Features > Set to Green > Save

...I get an "Object reference not set to an instance of an object" error.

The stacktrace shows that this is occuring in AntiForgeryAuthorizationFilter.cs
[NullReferenceException: Object reference not set to an instance of an object.]
   Orchard.Mvc.AntiForgery.AntiForgeryAuthorizationFilter.IsAntiForgeryProtectionEnabled(AuthorizationContext context) in z:\Builds\work\9f6cd39ff0f68f41\src\Orchard\Mvc\AntiForgery\AntiForgeryAuthorizationFilter.cs:50
   Orchard.Mvc.AntiForgery.AntiForgeryAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext) in z:\Builds\work\9f6cd39ff0f68f41\src\Orchard\Mvc\AntiForgery\AntiForgeryAuthorizationFilter.cs:30
   System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +155
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__19(AsyncCallback asyncCallback, Object asyncState) +1449
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +150
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object state, BeginInvokeDelegate beginDelegate, EndInvokeDelegate`1 endDelegate, Object tag, Int32 timeout) +96
   System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +467
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1c(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +45
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +111
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +150
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +203
   System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +839
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +150
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +154
   System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +479
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +108
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +111
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.Begin(AsyncCallback callback, Object state, Int32 timeout) +150
   System.Web.Mvc.Async.AsyncResultWrapper.Begin(AsyncCallback callback, Object callbackState, BeginInvokeDelegate`1 beginDelegate, EndInvokeVoidDelegate`1 endDelegate, TState invokeState, Object tag, Int32 timeout, SynchronizationContext callbackSyncContext) +203
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +665
   System.Threading.Tasks.TaskFactory`1.FromAsyncImpl(Func`4 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, Object state, TaskCreationOptions creationOptions) +4442910
   System.Threading.Tasks.TaskFactory.FromAsync(Func`4 beginMethod, Action`1 endMethod, TArg1 arg1, Object state, TaskCreationOptions creationOptions) +106
   System.Threading.Tasks.TaskFactory.FromAsync(Func`4 beginMethod, Action`1 endMethod, TArg1 arg1, Object state) +108
   Orchard.Mvc.Routes.<<ProcessRequestAsync>b__0>d__4.MoveNext() in z:\Builds\work\9f6cd39ff0f68f41\src\Orchard\Mvc\Routes\ShellRoute.cs:174
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
   Orchard.Owin.<<UseOrchard>b__0>d__2.MoveNext() in z:\Builds\work\9f6cd39ff0f68f41\src\Orchard\Owin\OrchardMiddleware.cs:17
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
   Orchard.Mvc.Routes.<ProcessRequestAsync>d__7.MoveNext() in z:\Builds\work\9f6cd39ff0f68f41\src\Orchard\Mvc\Routes\ShellRoute.cs:181
   System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +144
   System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +84
   System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar) +98
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
What am I doing wrong?