Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nicholas Westby 1893 posts 6332 karma points c-trib
    May 18, 2015 @ 23:09
    Nicholas Westby
    0

    Rare Null Exception in Polyglot GetLanguages

    enter image description here

    Here's my code that that you see in that stack trace: https://github.com/rhythmagency/rhythm.umbraco.extensions/blob/master/trunk/Rhythm.Extensions/Rhythm.Extensions/ExtensionMethods/PublishedContentExtensionMethods.cs#L852

    You can see that it calls Languages.GetDefaultLanguage (a Polyglot function). This is the first time I've seen this, so it must be pretty rare. Happened just after I rebuilt some DLL's and refreshed three pages (each in their own tabs). Error was only on one screen and went away after I refreshed again.

    Polyglot 2.04. Umbraco 7.2.4.

  • dimi309 244 posts 578 karma points
    May 19, 2015 @ 22:16
    dimi309
    0

    Hi,

    I am having a bit of trouble reproducing this. I can't seem to be able to make it happen. I am guessing that some value, either in my package or in the .NET framework (e.g. appsettings) or even in Umbraco (e.g. umbraco.cms.businesslogic.language.Language.GetAllAsList) was "emptied" when you rebuilt the dlls, but I can't be sure... sorry :( If it happens again and you come across any more information, please let me know.

    Thanks for the feedback in any case!

  • Nicholas Westby 1893 posts 6332 karma points c-trib
    Jul 06, 2015 @ 16:37
    Nicholas Westby
    0

    FYI, I noticed this log entry a few times after restarting the application pool on a site I just released:

    2015-07-02 17:46:30,653 [17] ERROR Umbraco.Core.UmbracoApplicationBase - [T32/D4] An unhandled exception occurred
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Dimi.Polyglot.BLL.Languages.GetLanguages(Boolean forBackOffice)
       at Dimi.Polyglot.BLL.Languages.GetDefaultLanguage()
       at Rhythm.Extensions.ExtensionMethods.PublishedContentExtensionMethods.LocalizationSelectedLanguage() in c:\r\rhythm\rhythm.umbraco.extensions\trunk\Rhythm.Extensions\Rhythm.Extensions\ExtensionMethods\PublishedContentExtensionMethods.cs:line 852
       at Rhythm.Extensions.ExtensionMethods.PublishedContentExtensionMethods.LocalizedPropertyValueHelper[T](DynamicNode page, String propertyAlias, Boolean recursive) in c:\r\rhythm\rhythm.umbraco.extensions\trunk\Rhythm.Extensions\Rhythm.Extensions\ExtensionMethods\PublishedContentExtensionMethods.cs:line 682
       at Rhythm.Extensions.ExtensionMethods.PublishedContentExtensionMethods.LocalizedPropertyValue[T](IPublishedContent source, String propertyAlias, Boolean recursive) in c:\r\rhythm\rhythm.umbraco.extensions\trunk\Rhythm.Extensions\Rhythm.Extensions\ExtensionMethods\PublishedContentExtensionMethods.cs:line 164
       at mysite.Extensions.Helpers.WidgetHelper.GetWidgets(IPublishedContent page, String alias) in c:\r\mysite\trunk\mysite.Extensions\Helpers\WidgetHelper.cs:line 27
       at ASP._Page_Views_Typical_cshtml.Execute() in d:\Websites\local.mysite.com\Views\Typical.cshtml:line 10
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
       at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
       at Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer)
       at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    

    The site also "broke" a few times (the custom 500 error page was showing), but I'm not sure if this was the cause or not.

  • dimi309 244 posts 578 karma points
    Jul 06, 2015 @ 20:27
    dimi309
    0

    I have not been able to reproduce this yet unfortunately. I am sorry about that :(. I will let you know if I figure something out.

Please Sign in or register to post replies

Write your reply to:

Draft