Error executing template "Designs/ClientBase_generated/Paragraph/HeaderWidgetLogo.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_74f0c72826a742be83a4534218487d7f.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\HeaderWidgetLogo.cshtml:line 36 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate()1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using System.Web; 4 @using Dynamicweb; 5 6 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 8 9 10 @{ 11 12 var paragraphID = Model.ItemId; 13 14 HeaderWidgetLogo _data = Dynamicweb.Services.Items.GetItem("HeaderWidgetLogo", paragraphID).ToCodeFirstItem<HeaderWidgetLogo>(); 15 BaseSettingsObj BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"]; 16 17 if (_data != null) 18 { 19 20 string LogoDesktopImage = (!string.IsNullOrWhiteSpace(_data.LogoDesktopImage.ToString())) ? _data.LogoDesktopImage.ToString() : ""; 21 22 /*** Desktop logo Settings ***/ 23 string header_logo__top = _data.LogoTop.ToString(); 24 header_logo__top = !string.IsNullOrWhiteSpace(header_logo__top) ? header_logo__top + "px" : "auto"; 25 26 string header_logo__left = _data.LogoLeft.ToString(); 27 header_logo__left = !string.IsNullOrWhiteSpace(header_logo__left) ? header_logo__left + "px" : "auto"; 28 29 string header_logo__width = _data.LogoWidth.ToString(); 30 header_logo__width = !string.IsNullOrWhiteSpace(header_logo__width) && header_logo__width != "0" ? header_logo__width + "px" : "auto"; 31 32 string header_logo__container_width = _data.LogoContainerWidth.ToString(); 33 header_logo__container_width = !string.IsNullOrWhiteSpace(header_logo__container_width) && header_logo__container_width != "0" ? header_logo__container_width + "px" : "auto"; 34 35 string header_logo__height = _data.LogoHeight.ToString(); 36 header_logo__height = !string.IsNullOrWhiteSpace(header_logo__height) && header_logo__height != "0" ? header_logo__height + "px" : "auto"; 37 38 <figure class="Header__logo Header__logo--@paragraphID"> 39 <a href="@BaseSettings.System.HomepageLink" aria-label="Logo"> 40 <img src="@LogoDesktopImage" alt="" /> 41 </a> 42 </figure> 43 44 <style> 45 46 .Header__logo--@paragraphID { 47 --Top: @header_logo__top; 48 --Left: @header_logo__left; 49 --Width: @header_logo__container_width; 50 } 51 52 .Header__logo--@paragraphID { 53 --Height: 100%; 54 --Width: @header_logo__width; 55 } 56 57 .Header__logo--@paragraphID img { 58 --Height: @header_logo__height; 59 --Width: @header_logo__width; 60 } 61 62 </style> 63 64 } 65 66 } 67