Skip to content

Commit 4374195

Browse files
committed
Code Quality: Guard DropAsync against null drag payload
1 parent 0e51c7d commit 4374195

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,15 @@ x.Item is ZipStorageFile ||
205205

206206
public async Task DropAsync(DragEventArgs e)
207207
{
208+
if (e is null)
209+
return;
210+
211+
if (e.DataView is null)
212+
{
213+
e.AcceptedOperation = DataPackageOperation.None;
214+
return;
215+
}
216+
208217
e.Handled = true;
209218
if (e.DataView.Contains(StandardDataFormats.Uri) && await e.DataView.GetUriAsync() is { } uri)
210219
{

0 commit comments

Comments
 (0)