Tree with Self referencing table with unknow depth

Good Day

I have a tree which is set to a self referencing table. The depth varies and i can only get it to display L1 and L2.

When i populate the "HasChildren" propety as per Blazor Tree data-binding i get a "Value cannot be null" error.

What am i doing wrong here:

<RadzenTree Data="@categories" Name="Tree0">
  <ChildContent>
    <RadzenTreeLevel ChildrenProperty="InventoryCategories1" HasChildren="@(e => (e as InventoryCategory).InventoryCategories1.Any())" TextProperty="description">
    </RadzenTreeLevel>
  </ChildContent>
</RadzenTree>


Most probably something is null as the exception suggests. My guess is that it is InventoryCategories1. You can add a null check to mitigate that

e => (e as InventoryCategory).InventoryCategories1?.Any() == true