Copied to clipboard

Flag this post as spam?

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


  • Christine 115 posts 288 karma points
    Apr 22, 2014 @ 16:35
    Christine
    0

    Error message when previewing a new post

    Hello Luke,

    I installed Smart blog and it works fine until I create a post, publish, and preview.  I get this error messages. I'm using version 2 with Umbraco version 7 working in visual studio 2010.

    Server Error in '/' Application.

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error: 

    Line 13:     foreach (IPublishedContent post in posts)
    Line 14:     {
    Line 15:         foreach (string category in post.GetProperty("smartBlogCategory").Value.ToString().Split(','))
    Line 16:         {
    Line 17:             if (categoryList.ContainsKey(category))


    Source File: c:\SRC\Konverge.WebSite.Umbraco\KonvergeUmbraco\Views\Partials\SmartListCategories.cshtml    Line: 15 

    Stack Trace: 

    [NullReferenceException: Object reference not set to an instance of an object.]
       ASP._Page_Views_Partials_SmartListCategories_cshtml.Execute() in c:\SRC\Konverge.WebSite.Umbraco\KonvergeUmbraco\Views\Partials\SmartListCategories.cshtml:15
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +103
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +256
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +93
       System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) +277
       System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +91
       System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName) +32
       ASP._Page_Views_SmartBlogContent_cshtml.Execute() in c:\SRC\Konverge.WebSite.Umbraco\KonvergeUmbraco\Views\SmartBlogContent.cshtml:16
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +103
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
       System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +233
       System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +10
       System.Web.WebPages.WebPageBase.Write(HelperResult result) +71
       System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +64
       System.Web.WebPages.WebPageBase.PopContext() +246
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +95
       System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +233
       System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +10
       System.Web.WebPages.WebPageBase.Write(HelperResult result) +71
       System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +64
       System.Web.WebPages.WebPageBase.PopContext() +246
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +95
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +256
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +93
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
       System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +245
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +22
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +245
       System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +22
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +176
       System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +310
       System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__19() +23
       System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
       System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
       System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
       System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9690164
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

     

     

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Apr 23, 2014 @ 09:23
    Alex Skrypnyk
    0

    Hi Christine,

    You have null in this place : post.GetProperty("smartBlogCategory").Value.

    Try to use check on null or fill this property.

    Thanks, Alex

  • Luke Alderton 192 posts 509 karma points
    Apr 23, 2014 @ 10:02
    Luke Alderton
    0

    Hi Christine,

    Does this only happen when you preview the post? Or does it happen on live posts too? Alex is indeed correct, but I'd like to be able to reproduce the error so I can make a fix and release it.

    Thanks, Luke

  • Christine 115 posts 288 karma points
    Apr 23, 2014 @ 15:45
    Christine
    0

    Hi Luke,

    When I created a post, the whole blog stopped working on the front end with the error message.  When I delete the post, the front end works again (well, the search is giving an error too but that is a different thread).  I'm not a developer so I'm not sure how I can check on null or fill the property :(

    Thanks for your help!

    Christine

  • Luke Alderton 192 posts 509 karma points
    Apr 23, 2014 @ 15:50
    Luke Alderton
    0

    Hi Christine,

    I'll have a look at release a fix for you this afternoon. Will you be okay with re-installing the blog one the update has been released?

    Thanks, Luke

  • Christine 115 posts 288 karma points
    Apr 23, 2014 @ 15:53
    Christine
    0

    Yes, that's no problem - thanks again!

  • Luke Alderton 192 posts 509 karma points
    Apr 23, 2014 @ 17:57
    Luke Alderton
    0

    Hi Christine.

    Could you try this version please? http://our.umbraco.org/FileDownload?id=10820 It (should) fix your problem, please let me know if it doesn't.

    Thanks, Luke

  • Christine 115 posts 288 karma points
    Apr 23, 2014 @ 18:11
    Christine
    0

    Hi Luke,

     

    Thanks, not getting that error anymore :)

     

    Christine

  • Luke Alderton 192 posts 509 karma points
    Apr 23, 2014 @ 18:18
    Luke Alderton
    0

    No problem, let me know if you need anything else.

Please Sign in or register to post replies

Write your reply to:

Draft