fix pathwidget NRE (#3537)

This commit is contained in:
Layla
2025-12-03 10:26:23 +00:00
committed by GitHub
parent f5534f980a
commit 14da06cd9d

View File

@@ -161,20 +161,20 @@ public class PathWidget : Widget
hasVisible = true;
}
ElipsesWidget.Paths.Clear();
ElipsesWidget?.Paths.Clear();
// what doesn't fit should be hidden, and added to the elipses menu
for ( int i = 0; i < Segments.Count; i++ )
{
Segments[i].Visible = i > truncIdx;
if ( !Segments[i].Visible )
if ( ElipsesWidget is not null && !Segments[i].Visible )
{
ElipsesWidget.Paths.Add( (Segments[i].Label, Segments[i].TargetPath) );
}
}
ElipsesWidget.Visible = truncIdx != -1;
ElipsesWidget?.Visible = truncIdx != -1;
}
string GetSegmentLabel( int index, string segment, AssetBrowser.Location location )