@@ -25,7 +25,7 @@ public sealed class FilesystemHelpers : IFilesystemHelpers
2525 private readonly IJumpListService jumpListService ;
2626 private IFilesystemOperations filesystemOperations ;
2727
28- private ItemManipulationModel itemManipulationModel => associatedInstance . SlimContentPage ? . ItemManipulationModel ;
28+ private ItemManipulationModel ? itemManipulationModel => associatedInstance . SlimContentPage ? . ItemManipulationModel ;
2929
3030 private readonly CancellationToken cancellationToken ;
3131 private static char [ ] RestrictedCharacters
@@ -58,7 +58,7 @@ public FilesystemHelpers(IShellPage associatedInstance, CancellationToken cancel
5858 jumpListService = Ioc . Default . GetRequiredService < IJumpListService > ( ) ;
5959 filesystemOperations = new ShellFilesystemOperations ( this . associatedInstance ) ;
6060 }
61- public async Task < ( ReturnResult , IStorageItem ) > CreateAsync ( IStorageItemWithPath source , bool registerHistory )
61+ public async Task < ( ReturnResult , IStorageItem ? ) > CreateAsync ( IStorageItemWithPath source , bool registerHistory )
6262 {
6363 var returnStatus = ReturnResult . InProgress ;
6464 var progress = new Progress < StatusCenterItemProgressModel > ( ) ;
@@ -363,7 +363,7 @@ public async Task<ReturnResult> CopyItemsFromClipboard(DataPackageView packageVi
363363 ReturnResult returnStatus = ReturnResult . InProgress ;
364364
365365 var destinations = new List < string > ( ) ;
366- List < ShellFileItem > binItems = null ;
366+ List < ShellFileItem > ? binItems = null ;
367367 foreach ( var item in source )
368368 {
369369 if ( RecycleBinHelpers . IsPathUnderRecycleBin ( item . Path ) )
@@ -511,7 +511,7 @@ public async Task<ReturnResult> MoveItemsFromClipboard(DataPackageView packageVi
511511 ReturnResult returnStatus = ReturnResult . InProgress ;
512512
513513 var destinations = new List < string > ( ) ;
514- List < ShellFileItem > binItems = null ;
514+ List < ShellFileItem > ? binItems = null ;
515515 foreach ( var item in source )
516516 {
517517 if ( RecycleBinHelpers . IsPathUnderRecycleBin ( item . Path ) )
@@ -551,7 +551,7 @@ await DialogDisplayHelper.ShowDialogAsync(
551551 return ReturnResult . Failed ;
552552 }
553553
554- IStorageHistory history = null ;
554+ IStorageHistory ? history = null ;
555555
556556 switch ( source . ItemType )
557557 {
@@ -658,7 +658,8 @@ public static bool IsValidForFilename(string name)
658658 {
659659 var itemPathOrName = string . IsNullOrEmpty ( item . src . Path ) ? item . src . Item . Name : item . src . Path ;
660660 incomingItems . Add ( new FileSystemDialogConflictItemViewModel ( ) { ConflictResolveOption = FileNameConflictResolveOptionType . None , SourcePath = itemPathOrName , DestinationPath = item . dest , DestinationDisplayName = Path . GetFileName ( item . dest ) } ) ;
661- if ( collisions . ContainsKey ( incomingItems . ElementAt ( item . index ) . SourcePath ) )
661+ var path = incomingItems . ElementAt ( item . index ) . SourcePath ;
662+ if ( path is not null && collisions . ContainsKey ( path ) )
662663 {
663664 // Something strange happened, log
664665 App . Logger . LogWarning ( $ "Duplicate key when resolving conflicts: { incomingItems . ElementAt ( item . index ) . SourcePath } , { item . src . Name } \n " +
@@ -870,6 +871,8 @@ public void Dispose()
870871 {
871872 filesystemOperations ? . Dispose ( ) ;
872873
874+ // SUPPRESS: Cannot convert null literal to non-nullable reference type.
875+ #pragma warning disable CS8625
873876 associatedInstance = null ;
874877 filesystemOperations = null ;
875878 }
0 commit comments