@@ -545,29 +545,57 @@ public async void LoadExtendedItemProperties(ListedItem item)
545
545
{
546
546
BitmapImage icon = new BitmapImage ( ) ;
547
547
var matchingItem = _filesAndFolders . FirstOrDefault ( x => x == item ) ;
548
- var matchingStorageItem = await StorageFile . GetFileFromPathAsync ( item . FilePath ) ;
549
- if ( matchingItem != null && matchingStorageItem != null )
548
+ try
550
549
{
551
- matchingItem . FileType = matchingStorageItem . DisplayType ;
552
- matchingItem . FolderRelativeId = matchingStorageItem . FolderRelativeId ;
553
- var Thumbnail = await matchingStorageItem . GetThumbnailAsync ( ThumbnailMode . ListView , 20 , ThumbnailOptions . UseCurrentScale ) ;
554
- if ( Thumbnail != null )
550
+ var matchingStorageItem = await StorageFile . GetFileFromPathAsync ( item . FilePath ) ;
551
+ if ( matchingItem != null && matchingStorageItem != null )
555
552
{
556
- matchingItem . FileImg = icon ;
557
- await icon . SetSourceAsync ( Thumbnail ) ;
558
- matchingItem . EmptyImgVis = Visibility . Collapsed ;
559
- matchingItem . FileIconVis = Visibility . Visible ;
553
+ matchingItem . FileType = matchingStorageItem . DisplayType ;
554
+ matchingItem . FolderRelativeId = matchingStorageItem . FolderRelativeId ;
555
+ var Thumbnail = await matchingStorageItem . GetThumbnailAsync ( ThumbnailMode . ListView , 20 , ThumbnailOptions . UseCurrentScale ) ;
556
+ if ( Thumbnail != null )
557
+ {
558
+ matchingItem . FileImg = icon ;
559
+ await icon . SetSourceAsync ( Thumbnail ) ;
560
+ matchingItem . EmptyImgVis = Visibility . Collapsed ;
561
+ matchingItem . FileIconVis = Visibility . Visible ;
562
+ }
560
563
}
561
564
}
565
+ catch ( UnauthorizedAccessException )
566
+ {
567
+ await App . consentDialog . ShowAsync ( ) ;
568
+ return ;
569
+ }
570
+ catch ( FileNotFoundException )
571
+ {
572
+ item . ItemPropertiesInitialized = true ;
573
+ return ;
574
+ }
575
+
562
576
}
563
577
else
564
578
{
565
579
var matchingItem = _filesAndFolders . FirstOrDefault ( x => x == item ) ;
566
- var matchingStorageItem = await StorageFolder . GetFolderFromPathAsync ( item . FilePath ) ;
567
- if ( matchingItem != null && matchingStorageItem != null )
580
+ try
568
581
{
569
- matchingItem . FolderRelativeId = matchingStorageItem . FolderRelativeId ;
582
+ var matchingStorageItem = await StorageFolder . GetFolderFromPathAsync ( item . FilePath ) ;
583
+ if ( matchingItem != null && matchingStorageItem != null )
584
+ {
585
+ matchingItem . FolderRelativeId = matchingStorageItem . FolderRelativeId ;
586
+ }
570
587
}
588
+ catch ( UnauthorizedAccessException )
589
+ {
590
+ await App . consentDialog . ShowAsync ( ) ;
591
+ return ;
592
+ }
593
+ catch ( FileNotFoundException )
594
+ {
595
+ item . ItemPropertiesInitialized = true ;
596
+ return ;
597
+ }
598
+
571
599
}
572
600
573
601
item . ItemPropertiesInitialized = true ;
@@ -630,6 +658,7 @@ public async void RapidAddItemsToCollectionAsync(string path)
630
658
catch ( UnauthorizedAccessException )
631
659
{
632
660
await App . consentDialog . ShowAsync ( ) ;
661
+ return ;
633
662
}
634
663
catch ( COMException e )
635
664
{
0 commit comments