Server Error in '/' Application.

Operator '!=' cannot be applied to operands of type 'Umbraco.Core.Dynamics.DynamicNull' and 'Umbraco.Web.Models.DynamicPublishedContent'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Operator '!=' cannot be applied to operands of type 'Umbraco.Core.Dynamics.DynamicNull' and 'Umbraco.Web.Models.DynamicPublishedContent'

Source Error:


Line 148:						<h1>@item.header</h1>
Line 149:						@item.tabContent
Line 150:						@if(contactText != null && contactNode != CurrentPage)
Line 151:						{
Line 152:							<a onclick="setCookie('@contactNode.Id');" href='@contactNode.Ancestors("Contact").First().Url' class="markBut" >@contactText</a>

Source File: d:\inetpub\wwwroot\Stonhard7\Views\MacroPartials\ResourceTab.cshtml    Line: 150

Stack Trace:


[RuntimeBinderException: Operator '!=' cannot be applied to operands of type 'Umbraco.Core.Dynamics.DynamicNull' and 'Umbraco.Web.Models.DynamicPublishedContent']
   CallSite.Target(Closure , CallSite , Object , Object ) +208
   System.Dynamic.UpdateDelegates.UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) +698
   ASP._Page_Views_MacroPartials_ResourceTab_cshtml.Execute() in d:\inetpub\wwwroot\Stonhard7\Views\MacroPartials\ResourceTab.cshtml:150
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +200
   Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult) +269
   Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content) +966
   umbraco.macro.LoadPartialViewMacro(MacroModel macro) +81
   umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId) +2797
   umbraco.presentation.templateControls.Macro.CreateChildControls() +2369
   System.Web.UI.Control.EnsureChildControls() +107
   umbraco.presentation.templateControls.Macro.OnInit(EventArgs e) +44
   System.Web.UI.Control.InitRecursive(Control namingContainer) +173
   System.Web.UI.Control.InitRecursive(Control namingContainer) +380
   System.Web.UI.Control.InitRecursive(Control namingContainer) +380
   System.Web.UI.Control.InitRecursive(Control namingContainer) +380
   System.Web.UI.Control.InitRecursive(Control namingContainer) +380
   System.Web.UI.Control.InitRecursive(Control namingContainer) +380
   System.Web.UI.Control.InitRecursive(Control namingContainer) +380
   System.Web.UI.Control.InitRecursive(Control namingContainer) +380
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +491


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0