Copied to clipboard

Flag this post as spam?

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


  • Jesper Lysgaard 12 posts 122 karma points
    Nov 09, 2018 @ 08:46
    Jesper Lysgaard
    0

    Merchello NullException after github fork

    Hi, After a fresh install of latest version of Merchello (forked from github) I get a NullException when trying to load the FastTrack demo site. The exception occurs in _ProductBox.cshtml:

    Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: source

    Source Error:

    Line 8:          {
    Line 9:              var images = Model.GetPropertyValue<List<IPublishedContent>>("image");
    Line 10:             if (images.Any())
    Line 11:             {
    Line 12:                 <a href="@Model.Url" alt="@Model.Name"><img class="img-responsive" src="@images.FirstOrDefault().GetCropUrl(200, 200)" alt="@Model.Name"></a>
    

    The backend runs fine. If I outcomment the problem lines in _ProductBox.cshtml it works as well - just without images.

    The images are present in the medialibrary and the ID's matches.

    Am I missing something obvious here? Has anyone experienced this? /Jesper

  • Jesper Lysgaard 12 posts 122 karma points
    Nov 11, 2018 @ 18:19
    Jesper Lysgaard
    100

    Ok -- found the answer: It seems that

    var images = Model.GetPropertyValue<List<IPublishedContent>>("image");
    

    Should be:

    var images = Model.GetPropertyValue<IEnumerable<IPublishedContent>>("image");
    
Please Sign in or register to post replies

Write your reply to:

Draft