File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,6 @@ await CoreApplication.MainView.DispatcherQueue.EnqueueAsync(async () =>
133
133
} ) ;
134
134
}
135
135
136
-
137
136
public void SaveModel ( )
138
137
{
139
138
suppressChangeEvent = true ;
Original file line number Diff line number Diff line change @@ -410,15 +410,17 @@ public void RemoveStaleSidebarItems()
410
410
{
411
411
// Remove unpinned items from sidebar
412
412
// Reverse iteration to avoid skipping elements while removing
413
- for ( int i = favoriteSection . ChildItems . Count - 1 ; i >= 0 ; i -- )
413
+ if ( favoriteSection != null )
414
414
{
415
- var childItem = favoriteSection . ChildItems [ i ] ;
416
- if ( childItem is LocationItem )
415
+ for ( int i = favoriteSection . ChildItems . Count - 1 ; i >= 0 ; i -- )
417
416
{
418
- var item = childItem as LocationItem ;
419
- if ( ! item . IsDefaultLocation && ! FavoriteItems . Contains ( item . Path ) )
417
+ var childItem = favoriteSection . ChildItems [ i ] ;
418
+ if ( childItem is LocationItem item )
420
419
{
421
- favoriteSection . ChildItems . RemoveAt ( i ) ;
420
+ if ( ! item . IsDefaultLocation && ! FavoriteItems . Contains ( item . Path ) )
421
+ {
422
+ favoriteSection . ChildItems . RemoveAt ( i ) ;
423
+ }
422
424
}
423
425
}
424
426
}
You can’t perform that action at this time.
0 commit comments