@@ -1209,31 +1209,38 @@ public void PopulateOmnibarSuggestionsForCommandPaletteMode()
12091209
12101210 dispatcherQueue . TryEnqueue ( ( ) =>
12111211 {
1212- var selectedItemPath = ContentPageContext . SelectedItem . ItemPath ;
1213- var fileActionEntity = ActionManager . Instance . EntityFactory . CreateFileEntity ( selectedItemPath ) ;
1214- var actions = ActionManager . Instance . ActionRuntime . ActionCatalog . GetActionsForInputs ( new [ ] { fileActionEntity } ) ;
1215-
1216- foreach ( var action in actions . Where ( a => a . Definition . Description . Contains ( OmnibarCommandPaletteModeText , StringComparison . OrdinalIgnoreCase ) ) )
1212+ try
12171213 {
1218- var newItem = new NavigationBarSuggestionItem
1219- {
1220- PrimaryDisplay = action . Definition . Description ,
1221- SearchText = OmnibarCommandPaletteModeText ,
1222- ActionInstance = action
1223- } ;
1214+ var selectedItemPath = ContentPageContext . SelectedItem . ItemPath ;
1215+ var fileActionEntity = ActionManager . Instance . EntityFactory . CreateFileEntity ( selectedItemPath ) ;
1216+ var actions = ActionManager . Instance . ActionRuntime . ActionCatalog . GetActionsForInputs ( new [ ] { fileActionEntity } ) ;
12241217
1225- if ( Uri . TryCreate ( action . Definition . IconFullPath , UriKind . RelativeOrAbsolute , out Uri ? validUri ) )
1218+ foreach ( var action in actions . Where ( a => a . Definition . Description . Contains ( OmnibarCommandPaletteModeText , StringComparison . OrdinalIgnoreCase ) ) )
12261219 {
1227- try
1220+ var newItem = new NavigationBarSuggestionItem
12281221 {
1229- newItem . ActionIconSource = new BitmapImage ( validUri ) ;
1230- }
1231- catch ( Exception )
1222+ PrimaryDisplay = action . Definition . Description ,
1223+ SearchText = OmnibarCommandPaletteModeText ,
1224+ ActionInstance = action
1225+ } ;
1226+
1227+ if ( Uri . TryCreate ( action . Definition . IconFullPath , UriKind . RelativeOrAbsolute , out Uri ? validUri ) )
12321228 {
1229+ try
1230+ {
1231+ newItem . ActionIconSource = new BitmapImage ( validUri ) ;
1232+ }
1233+ catch ( Exception )
1234+ {
1235+ }
12331236 }
1234- }
12351237
1236- OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1238+ OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1239+ }
1240+ }
1241+ catch ( Exception ex )
1242+ {
1243+ App . Logger . LogWarning ( ex , ex . Message ) ;
12371244 }
12381245 } ) ;
12391246 }
0 commit comments