Exception in template (Designs\Fusion\ItemPublisher/List/ListInspiratie.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.ceacfbadcffdcf.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@{ var events = GetLoop("ItemPublisher:Items.List"); var productPageID = ""; if(System.Web.HttpContext.Current.Request.Cookies["BFsection"].Value == "6") { productPageID = Translate("Product Page ID","8"); } else { productPageID = Translate("Product Page ID Infrastructura","29"); } } <div class="flexslider inspiratie-main-carousel"> <ul class="slides"> @{ int i = 0; } @foreach (var evnt in events) { <li> <div class="item"> <div class="big-image-container"> <div class="big-image-wrap"> <img src="/Admin/Public/GetImage.ashx?image=@evnt.Values["ItemPublisher:Item.Imagine"]&width=747&height=697&compression=70&crop=0" width="747" heigh="697" class="img-responsive"/> </div> </div> <div class="inspiratie-list pull-right"> @{ string slide = evnt.Values["ItemPublisher:Item.Item_List"] != null ? evnt.Values["ItemPublisher:Item.Item_List"].ToString() : ""; if (!string.IsNullOrEmpty(slide)) { string[] list = slide.Split(','); int count = 1; <p class="headline">@Translate("Detalii produs","Detalii produs")</p> foreach (string itemId in list) { Dynamicweb.Content.Items.Item miniSlide = Dynamicweb.Content.Items.Item.GetItemById("Inspiratie_Product_Item", itemId); string productID = miniSlide != null ? miniSlide["Product"].ToString().Split(':')[0].Replace("p_", ""): ""; string variantID = miniSlide != null ? miniSlide["Product"].ToString().Split(':')[1] : ""; if(!string.IsNullOrEmpty(productID) && !string.IsNullOrEmpty(variantID)){ Dynamicweb.eCommerce.Products.Product variant = Dynamicweb.eCommerce.Products.Product.GetProductByID(productID, variantID); if (variant != null){ Dynamicweb.eCommerce.Products.Product product = Dynamicweb.eCommerce.Products.Product.GetProductByID(productID); string productLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id="+productPageID+"&groupid="+product.Groups[0].ID+"&productid="+productID); <p>@variant.ImageSmall</p> <div class="inspiratie-item-list"> <a href="@productLink" class="inspiratie-product-image"><img src='Files/@variant.ImageLarge' alt="" class="img-responsive" /></a> <div class=" inspiratie-product-description"> <p><a href="@productLink"><strong>@product.Name</strong></a></p> @variant.ShortDescription </div> </div> count++; } } } } } </div> </div> </li> i++; } </ul> </div> <div class="flexslider inspiratie-main-carousel-control"> <ul class="slides" data-count='@events.Count()'> @{ int j = 0; } @foreach (var evnt in events) { <li> <div class="item"> @{ <a href="#"> @* <img src='@evnt.Values["ItemPublisher:Item.Imagine"].ToString().Replace("inspiratie/","inspiratie/thumb/").Replace("cazuistici","cazuistici/thumb").Replace(".jpg","_thumb.jpg")' alt="" class="img-responsive" /> *@ <img src="/Admin/Public/GetImage.ashx?image=@evnt.Values["ItemPublisher:Item.Imagine"]&width=100&height=93&compression=70&crop=0" width="100" heigh="93" class="img-responsive"/> </a> string slide = evnt.Values["ItemPublisher:Item.Item_List"].ToString(); } </div> </li> i++; } </ul> </div>