File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
src/Files.App/Actions/Start Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,15 @@ public async Task ExecuteAsync(object? parameter = null)
3737 {
3838 foreach ( ListedItem listedItem in context . ShellPage . SlimContentPage . SelectedItems )
3939 {
40- IStorable storable = listedItem . IsFolder switch
40+ await SafetyExtensions . IgnoreExceptions ( async ( ) =>
4141 {
42- true => await StorageService . GetFolderAsync ( listedItem . ItemPath ) ,
43- _ => await StorageService . GetFileAsync ( ( listedItem as ShortcutItem ) ? . TargetPath ?? listedItem . ItemPath )
44- } ;
45- await StartMenuService . PinAsync ( storable , listedItem . Name ) ;
42+ IStorable storable = listedItem . IsFolder switch
43+ {
44+ true => await StorageService . GetFolderAsync ( listedItem . ItemPath ) ,
45+ _ => await StorageService . GetFileAsync ( ( listedItem as ShortcutItem ) ? . TargetPath ?? listedItem . ItemPath )
46+ } ;
47+ await StartMenuService . PinAsync ( storable , listedItem . Name ) ;
48+ } ) ;
4649 }
4750 }
4851 else if ( context . ShellPage ? . ShellViewModel ? . CurrentFolder is not null )
Original file line number Diff line number Diff line change @@ -33,12 +33,15 @@ public async Task ExecuteAsync(object? parameter = null)
3333 {
3434 foreach ( ListedItem listedItem in context . ShellPage ? . SlimContentPage . SelectedItems )
3535 {
36- IStorable storable = listedItem . IsFolder switch
36+ await SafetyExtensions . IgnoreExceptions ( async ( ) =>
3737 {
38- true => await StorageService . GetFolderAsync ( listedItem . ItemPath ) ,
39- _ => await StorageService . GetFileAsync ( ( listedItem as ShortcutItem ) ? . TargetPath ?? listedItem . ItemPath )
40- } ;
41- await StartMenuService . UnpinAsync ( storable ) ;
38+ IStorable storable = listedItem . IsFolder switch
39+ {
40+ true => await StorageService . GetFolderAsync ( listedItem . ItemPath ) ,
41+ _ => await StorageService . GetFileAsync ( ( listedItem as ShortcutItem ) ? . TargetPath ?? listedItem . ItemPath )
42+ } ;
43+ await StartMenuService . UnpinAsync ( storable ) ;
44+ } ) ;
4245 }
4346 }
4447 else
You can’t perform that action at this time.
0 commit comments