"Object reference not set to an instance of an object" when setting the API key

Feb 13, 2016 at 5:01 PM
Hello,
I get the following error when I try and set the MailChimp API key in the MailChimp API Key admin page :
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
Line 48:
Line 49: var currentModule = GetArea(context.RouteData);
Line 50: return !String.IsNullOrEmpty(currentModule)
Line 51: && (_extensionManager.AvailableExtensions()
Line 52: .First(descriptor => String.Equals(descriptor.Id, currentModule, StringComparison.OrdinalIgnoreCase))

Source File: E:\Projects\eCommerce\v2\Orchard1.9.2\Orchard\Mvc\AntiForgery\AntiForgeryAuthorizationFilter.cs Line: 50
I guess the module was not properly installed, but uninstalling/reinstalling the module won't help...

Any idea?
Thanks for your help!
Coordinator
Feb 23, 2016 at 10:22 AM
I've not tested this module in Orchard 1.9.2 so I can't guarantee that it works. The error you're seeing is not in any code I've written and it's not an error I've come accross before. It may be unrelated to my module and there may be more than one thing that would make it happen.

Looking at the code it seems that either _extensionManager is null, or AvailableExtensions() is returning null.

I'm not currently doing any active Orchard development. The first thing I would do to check that my module is or is not working correctly in Orchard 1.9.2 is I would install a new clean version of Orchard and only install my module. If set up works fine, then the problem lies with something else in your site. If you get the same error, then the issue is with my module.
Mar 15, 2016 at 12:45 PM
serivas wrote:
Hello,
I get the following error when I try and set the MailChimp API key in the MailChimp API Key admin page :
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:
Line 48:
Line 49: var currentModule = GetArea(context.RouteData);
Line 50: return !String.IsNullOrEmpty(currentModule)
Line 51: && (_extensionManager.AvailableExtensions()
Line 52: .First(descriptor => String.Equals(descriptor.Id, currentModule, StringComparison.OrdinalIgnoreCase))

Source File: E:\Projects\eCommerce\v2\Orchard1.9.2\Orchard\Mvc\AntiForgery\AntiForgeryAuthorizationFilter.cs Line: 50
I guess the module was not properly installed, but uninstalling/reinstalling the module won't help...

Any idea?
Thanks for your help!
Adding AntiForgery: enabled to the Module.txt will solve the issue