DNN: 4.00.02
I'm periodically gettin this exception. I finally hit it in the debugger at the following line:
If (Not GetSupportedLocales(userLanguage) Is Nothing) AndAlso (GetSupportedLocales(userLanguage).Fallback.ToLower <> "") Then
It appears that GetSupportedLocales(userLanguage) is returning Null when this happens. As such, GetSupportedLocales(userLanguage).Fallback is generating the null reference exception. I believe that reading this code the expectation is that if GetSupportedLocales(userLanguage) is null, then the second part of the if should not be check, but is. Could this be a timing issue where the first time GetSupportedLocales() succeeds, but the 2nd one fails?
It seems to me the fix would be:
Dim objLocales As LocaleCollection = GetSupportedLocales(userLanguage)
If (Not objLocales Is Nothing) AndAlso (objLocales.FallbackToLower <> "") Then
Detailed exception follows:
AssemblyVersion: 04.00.02
Method: DotNetNuke.Services.Localization.Localization.GetResource
FileName:
FileLineNumber: 0
FileColumnNumber: 0
PortalID: 0
PortalName: Meadowdale High School Class of 1987
UserID: -1
UserName:
ActiveTabID: 73
ActiveTabName: Now and Then - H-J's
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer:
ExceptionGUID: aecc56b8-c717-4a76-8d42-65b7ee4c3184
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
InnerException: Object reference not set to an instance of an object.
Message: DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Services.Localization.Localization.GetResource(String ResourceFileRoot, PortalSettings objPortalSettings, String strLanguage) at DotNetNuke.Services.Localization.Localization.GetString(String name, String ResourceFileRoot, PortalSettings objPortalSettings, String strLanguage) at DotNetNuke.Services.Localization.Localization.GetString(String name) at DotNetNuke.Services.Exceptions.ErrorContainer..ctor(PortalSettings _PortalSettings, String strError, Exception exc) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) at DotNetNuke.UI.Skins.Skin.Page_Init(Object sender, EventArgs e) at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.UserControl.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at DotNetNuke.Framework.DefaultPage.Page_Init(Object sender, EventArgs e) in E:\inetpub\MHS87\Default.aspx.vb:line 490 at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Page.OnInit(EventArgs e) at DotNetNuke.Framework.PageBase.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---