File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/Files.App/ViewModels/Layouts Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,14 @@ public async Task DragOverAsync(DragEventArgs e)
101101 return ;
102102 }
103103
104+ // Check if ShellViewModel is initialized to prevent race condition
105+ if ( _associatedInstance . ShellViewModel is null )
106+ {
107+ e . AcceptedOperation = DataPackageOperation . None ;
108+ deferral . Complete ( ) ;
109+ return ;
110+ }
111+
104112 if ( FilesystemHelpers . HasDraggedStorageItems ( e . DataView ) )
105113 {
106114 e . Handled = true ;
@@ -207,6 +215,13 @@ public async Task DropAsync(DragEventArgs e)
207215 }
208216 }
209217
218+ // Check if ShellViewModel is initialized to prevent race condition
219+ if ( _associatedInstance . ShellViewModel is null )
220+ {
221+ e . AcceptedOperation = DataPackageOperation . None ;
222+ return ;
223+ }
224+
210225 var deferral = e . GetDeferral ( ) ;
211226 try
212227 {
You can’t perform that action at this time.
0 commit comments