Skip to content
12 changes: 12 additions & 0 deletions src/Files.App/Utils/Archives/DecompressHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,18 @@ public static async Task DecompressArchiveHereAsync(IShellPage associatedInstanc
if (associatedInstance == null)
return;

if (associatedInstance.SlimContentPage == null)
return;

foreach (var selectedItem in associatedInstance.SlimContentPage.SelectedItems)
{
var password = string.Empty;
BaseStorageFile archive = await StorageHelpers.ToStorageItem<BaseStorageFile>(selectedItem.ItemPath);
BaseStorageFolder currentFolder = await StorageHelpers.ToStorageItem<BaseStorageFolder>(associatedInstance.FilesystemViewModel.CurrentFolder.ItemPath);

if (archive is null)
return;

if (await FilesystemTasks.Wrap(() => IsArchiveEncrypted(archive)))
{
DecompressArchiveDialog decompressArchiveDialog = new();
Expand Down Expand Up @@ -205,6 +211,9 @@ public static async Task DecompressArchiveToChildFolderAsync(IShellPage associat
if (associatedInstance == null)
return;

if (associatedInstance.SlimContentPage == null)
return;

foreach (var selectedItem in associatedInstance.SlimContentPage.SelectedItems)
{
var password = string.Empty;
Expand All @@ -213,6 +222,9 @@ public static async Task DecompressArchiveToChildFolderAsync(IShellPage associat
BaseStorageFolder currentFolder = await StorageHelpers.ToStorageItem<BaseStorageFolder>(associatedInstance.FilesystemViewModel.CurrentFolder.ItemPath);
BaseStorageFolder destinationFolder = null;

if (archive is null)
return;

if (await FilesystemTasks.Wrap(() => DecompressHelper.IsArchiveEncrypted(archive)))
{
DecompressArchiveDialog decompressArchiveDialog = new();
Expand Down