diff --git a/Terminal.Gui/Views/TreeView.cs b/Terminal.Gui/Views/TreeView.cs index afca00762..00d2977ff 100644 --- a/Terminal.Gui/Views/TreeView.cs +++ b/Terminal.Gui/Views/TreeView.cs @@ -48,7 +48,7 @@ namespace Terminal.Gui { /// public override string ToString() { - return Text; + return Text ?? "Unamed Node"; } /// @@ -338,7 +338,7 @@ namespace Terminal.Gui { /// Returns the string representation of model objects hosted in the tree. Default implementation is to call /// /// - public AspectGetterDelegate AspectGetter {get;set;} = (o)=>o.ToString(); + public AspectGetterDelegate AspectGetter {get;set;} = (o)=>o.ToString() ?? ""; /// /// Creates a new tree view with absolute positioning. Use to set set root objects for the tree. Children will not be rendered until you set