Copied to clipboard

Flag this post as spam?

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


  • Andrew Unger 45 posts 148 karma points
    Jul 13, 2020 @ 18:22
    Andrew Unger
    0

    Cannot perform runtime binding on a null reference

    I am really not sure what is causing this issue and could use some help. So basically we have a site that has a doctype called "product" and another doctype that is called "product(copy)" with the alias "morrellsProduct_Copy" that just has a multitreenode picker with the alias "copiedProduct" that is used to select that original product page. I get an error on the product copy page that looks like this

    enter image description here

    I have checked the doctype alias in the if statement to make sure it is the correct one as well as the property value that is inside the if statement. What's also strange is we have a test site and it's using the exact same code, but the product copy page works fine on the test site. If anyone has any suggestions as to what could cause this to happen I would appreciate it. Also I am using version 7.5.14 Here is the code block that breaks.

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
     @using ContentModels = Umbraco.Web.PublishedContentModels;
     @using Archetype.Models;
     @using Morrells.WEB;
     @using Morrells.WEB.Models;
    
    @{
    Layout = "MorrellsMaster.cshtml";
    
      dynamic _CurrentPage = CurrentPage;
      if (CurrentPage.DocumentTypeAlias == "morrellsProduct_Copy")
      {
        _CurrentPage = CurrentPage.GetPropertyValue<IEnumerable<Umbraco.Web.Models.DynamicPublishedContent>>("copiedProduct").First();
      }
    }
    
  • Amir Khan 1282 posts 2739 karma points
    Jul 13, 2020 @ 18:37
    Amir Khan
    0

    This might be dumb, but is it possible that the MNTP on the production site doesn't have anything picked or that the cache needs to be refreshed?

  • Andrew Unger 45 posts 148 karma points
    Jul 13, 2020 @ 18:40
    Andrew Unger
    0

    There is something picked on the MNTP. I tried refreshing the browser's cache I'm not sure if that's what you mean or not.

  • Amir Khan 1282 posts 2739 karma points
    Jul 13, 2020 @ 18:41
    Amir Khan
    0

    Sorry, meant the Umbraco cache, click on the top of the content tree and "republish entire site".

  • Andrew Unger 45 posts 148 karma points
    Jul 13, 2020 @ 18:44
    Andrew Unger
    0

    Unfortunately that did not work either I just tried it.

Please Sign in or register to post replies

Write your reply to:

Draft