Cannot perform runtime binding on a null reference

I have a Macro that I've used on several sites. I built it in my core site that I base all other sites on. I just returned to that site to do some other development and noticed the main menu is not working.

I get this error:

Cannot perform runtime binding on a null reference 
at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at ASP._Page_Views_MacroPartials__Navigation_cshtml.Execute() in [snip]\MacroPartials\_Navigation.cshtml:line 39

Here is the code:

@if (nav != null)
{
<nav class="@nav.GetPropertyValue("Navigation CSS Class ")">
<ul>
@foreach (IPublishedContent item in nav.Children())
{
if (item.HasValue("Link"))
{
try
{
IPublishedContent link = item.GetPropertyValue<IPublishedContent>("Link");

<li class="@((page.Id == link.Id) ? "selected" : "") @item.GetPropertyValue("Link CSS Class")"><a href="@link.Url">@item.GetPropertyValue("Text")</a></li>
}
catch (Exception ex)
{
<li>@ex.Message <pre>@ex.StackTrace</pre></li>
}
}
}
</ul>
</nav>
}

This is the line that fails:

IPublishedContent link = item.GetPropertyValue<IPublishedContent>("Link");

This is currently working fine on five other websites and was working on this one until I returned to it today.

I have no idea what's causing the error, can anyone help?

Jon


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/61196-cannot-perform-runtime-binding-on-a-null-reference