@@ -1209,31 +1209,38 @@ public void PopulateOmnibarSuggestionsForCommandPaletteMode()
1209
1209
1210
1210
dispatcherQueue . TryEnqueue ( ( ) =>
1211
1211
{
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
1217
1213
{
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 } ) ;
1224
1217
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 ) ) )
1226
1219
{
1227
- try
1220
+ var newItem = new NavigationBarSuggestionItem
1228
1221
{
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 ) )
1232
1228
{
1229
+ try
1230
+ {
1231
+ newItem . ActionIconSource = new BitmapImage ( validUri ) ;
1232
+ }
1233
+ catch ( Exception )
1234
+ {
1235
+ }
1233
1236
}
1234
- }
1235
1237
1236
- OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1238
+ OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1239
+ }
1240
+ }
1241
+ catch ( Exception ex )
1242
+ {
1243
+ App . Logger . LogWarning ( ex , ex . Message ) ;
1237
1244
}
1238
1245
} ) ;
1239
1246
}
0 commit comments