Closed orchardbot closed 9 years ago
DavidHayden commented:
Actually, the code above gets run a lot and causes a flood of exceptions.
@sebastienros commented:
Fixed in changeset f4c1b358bd44
@sfmskywalker commented:
Fixed in changeset 28e378dfaedc3d27cff4f2a22c0720e6d33f4b49
DavidHayden created: https://orchard.codeplex.com/workitem/18801
When editing role-based permissions we get a NullReferenceException filling up the Log File:
2012-07-10 14:31:40,264 [80] Orchard.Exceptions.DefaultExceptionPolicy - An unexpected exception was caught System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Orchard.CustomForms.Security.AuthorizationEventHandler.Adjust(CheckAccessContext context) --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Orchard.Events.DefaultOrchardEventBus.TryInvokeMethod(IEventHandler eventHandler, Type interfaceType, String methodName, IDictionary2 arguments, IEnumerable& returnValue) in D:\orchard-src-1.5-rc\src\Orchard\Events\DefaultOrchardEventBus.cs:line 83 at Orchard.Events.DefaultOrchardEventBus.TryInvoke(IEventHandler eventHandler, String interfaceName, String methodName, IDictionary2 arguments, IEnumerable& returnValue) in D:\orchard-src-1.5-rc\src\Orchard\Events\DefaultOrchardEventBus.cs:line 68 at Orchard.Events.DefaultOrchardEventBus.TryNotifyHandler(IEventHandler eventHandler, String messageName, String interfaceName, String methodName, IDictionary`2 eventData, IEnumerable& returnValue) in D:\orchard-src-1.5-rc\src\Orchard\Events\DefaultOrchardEventBus.cs:line 52
Here is the culprit: "context.content" is Null and causes the exception. ///
/// Alters the Edit permission requested by the Contents module before editing a form. Returns a Submit permission instead. ///
[UsedImplicitly] public class AuthorizationEventHandler : IAuthorizationServiceEventHandler { public void Checking(CheckAccessContext context) { } public void Complete(CheckAccessContext context) { }
}
Regards,
Dave