Re: RolProvider throw error sometime
I've only ever seen that when first setting up a site if an error occurs and siteSettings is a null object that error will happen in the constructor of mojoRoleProvider.
I've never seen it happen once a site has been correctly configured.
maybe should change the constructor code to be like this:
public mojoRoleProvider()
{
if (HttpContext.Current != null)
{
siteSettings = SiteSettings.GetCurrent();
if(siteSettings != null)
{
this.applicationName = siteSettings.SiteName;
}
}
}
adding the check for null
but then again if siteSettings is null maybe its best if an error is raised, I suppose I could throw an error which would give more info about the problem. The error is probably in the mojoportal error log ~/Data/currentlog.config
The real solution is most likely find the cause of siteSettings being null sometimes which I guess is what is happening for you. Again, I have only seen this happen in initial site setup when some setup isse causes siteSettings to be null.
Joe