C# Razor template throws error when ListContent Title is null

description

Long time fan. The newest version is amazing. Everyone is loving the interface. :D

I'm wondering if you can help me with a problem I've struggled with for a while now. I don't think it's related to the module version but perhaps my C# template.

When I have a listing (like a Board of Directors, for example), whenever I add the first item, my c# razor template throws an error because I haven't defined
@ListContent.Title yet. But I can't edit the title without adding multiple items first. So my problem (and my workaround) looks like this:

It's a lot of roundabout steps and I'm wondering how can I avoid this issue? I've tried putting in conditional statements around the
@ListContent.Title value (and other @ListContent values) but it doesn't fix the problem. I still have to completely remove it until it actually becomes a list (by adding at least a second item). This problem
happens on all of my lists (templates with List Enabled).

Here is the error that appears:

There was an error while rendering the template: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 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 CallSite.Target(Closure , CallSite , Object ) at ASP._Page_Portals_0_2sxc_Content__Board_of_Directors_cshtml.Execute() in d:\home\site\wwwroot\Portals\0\2sxc\Content\_Board of Directors.cshtml:line 9 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at ...