Skip to content

Commit 86f1d11

Browse files
hishitetsu0x5bfa
andauthored
Fix: Fixed NullReferenceException in BaseDeleteAction.DeleteItemsAsync (#15467)
Co-authored-by: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
1 parent eb23363 commit 86f1d11

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Files.App/Actions/FileSystem/BaseDeleteAction.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ item.PrimaryItemAttribute is StorageItemTypes.File
3434
? FilesystemItemType.File
3535
: FilesystemItemType.Directory));
3636

37-
await context.ShellPage!.FilesystemHelpers.DeleteItemsAsync(items, settings.DeleteConfirmationPolicy, permanently, true);
38-
39-
await context.ShellPage.FilesystemViewModel.ApplyFilesAndFoldersChangesAsync();
37+
if (context.ShellPage is IShellPage shellPage)
38+
{
39+
await shellPage.FilesystemHelpers.DeleteItemsAsync(items, settings.DeleteConfirmationPolicy, permanently, true);
40+
await shellPage.FilesystemViewModel.ApplyFilesAndFoldersChangesAsync();
41+
}
4042
}
4143

4244
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)

0 commit comments

Comments
 (0)