Exception in template (Designs/BS/_parsed/Blog.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.ffacfbcdbcfbad.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@using System.Text.RegularExpressions @using Dynamicweb @using Dynamicweb.Modules.UserManagement @using System.Web.Optimization <!DOCTYPE html> <html lang="en"> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @{ Dynamicweb.Modules.UserManagement.User user = Dynamicweb.Modules.UserManagement.User.get_Current(PagePermissionLevels.Frontend); #region custom fields //user custom fields validation string digitalCustomer = ""; string digitalDistributer = ""; string t_NoProductsFound = Translate("t_NoProductsFound"); string googleAnalytics = Dynamicweb.Frontend.PageView.Current().Area.Item["GoogleAnalyticsID"].ToString(); try { if (user != null) { digitalCustomer = user.CustomFieldValues.Find(p => p.CustomField.SystemName.Equals("AccessUser_EGDivibibCustomer")).Value.ToString(); digitalDistributer = user.CustomFieldValues.Find(p => p.CustomField.SystemName.Equals("AccessUser_EGEmediaVendId")).Value.ToString(); } } catch { } if (digitalCustomer == null || digitalCustomer.Equals("")) { digitalCustomer = "False"; } if (digitalDistributer == null || digitalDistributer.Equals("")) { digitalDistributer = "False"; } #endregion string favico = Dynamicweb.Frontend.PageView.Current().Area.Item["FavIco"].ToString(); } <head> <meta charset=UTF-8