This repository was archived by the owner on Jul 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-17
lines changed
Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ private static void HandleMember(MemberAttribute member)
103103 }
104104 else return ;
105105
106- string highest = member . Parts . Length == 1 ? null : member . Parts [ 0 ] ;
106+ string highest = member . Parts . Length == 1 ? "Uncategorized" : member . Parts [ 0 ] ;
107107
108108 // this needs to be rewritten
109109 UIGroup lowest = null ;
@@ -120,26 +120,27 @@ private static void HandleMember(MemberAttribute member)
120120 lowest . RegisterAsHighest ( ) ;
121121 }
122122
123- foreach ( string section in member . Parts [ 1 ..^ 1 ] )
124- {
125- bool found = false ;
126-
127- foreach ( UIElement elem in lowest . elements )
123+ if ( member . Parts . Length >= 2 )
124+ foreach ( string section in member . Parts [ 1 ..^ 1 ] )
128125 {
129- if ( elem is not UIElement < UIGroup > group || elem . name != section )
130- continue ;
126+ bool found = false ;
127+
128+ foreach ( UIElement elem in lowest . elements )
129+ {
130+ if ( elem is not UIElement < UIGroup > group || elem . name != section )
131+ continue ;
132+
133+ lowest = group . Bound . _value ;
134+ found = true ;
135+ break ;
136+ }
137+
138+ if ( found ) continue ;
131139
132- lowest = group . Bound . _value ;
133- found = true ;
134- break ;
140+ Plugin . Logger . LogDebug ( "Creating new section: " + section ) ;
141+ lowest = new ( section , lowest ) ;
135142 }
136143
137- if ( found ) continue ;
138-
139- Plugin . Logger . LogDebug ( "Creating new section: " + section ) ;
140- lowest = new ( section , lowest ) ;
141- }
142-
143144 lowest . AddElement ( element ) ;
144145 }
145146
You can’t perform that action at this time.
0 commit comments