Skip to content

Commit 98bca3a

Browse files
committed
Fix opening zip files
1 parent 729485c commit 98bca3a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Files.App/Filesystem/StorageFileHelpers/StorageFileExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public async static Task<BaseStorageFile> DangerousGetFileFromPathAsync
157157
public async static Task<StorageFileWithPath> DangerousGetFileWithPathFromPathAsync
158158
(string value, StorageFolderWithPath rootFolder = null, StorageFolderWithPath parentFolder = null)
159159
{
160-
if (rootFolder is not null || parentFolder is not null)
160+
if (rootFolder is not null)
161161
{
162162
var currComponents = GetDirectoryPathComponents(value);
163163

@@ -175,7 +175,7 @@ public async static Task<StorageFileWithPath> DangerousGetFileWithPathFromPathAs
175175
path = PathNormalization.Combine(path, file.Name);
176176
return new StorageFileWithPath(file, path);
177177
}
178-
else if (rootFolder is not null && value.IsSubPathOf(rootFolder.Path))
178+
else if (value.IsSubPathOf(rootFolder.Path))
179179
{
180180
var folder = rootFolder.Item;
181181
var path = rootFolder.Path;
@@ -195,7 +195,7 @@ public async static Task<StorageFileWithPath> DangerousGetFileWithPathFromPathAs
195195
: value;
196196
var item = await BaseStorageFile.GetFileFromPathAsync(fullPath);
197197

198-
if (parentFolder is not null && parentFolder.Path.IsSubPathOf(value) && parentFolder.Item is IPasswordProtectedItem ppis && item is IPasswordProtectedItem ppid)
198+
if (parentFolder is not null && parentFolder.Item is IPasswordProtectedItem ppis && item is IPasswordProtectedItem ppid)
199199
ppid.Credentials = ppis.Credentials;
200200

201201
return new StorageFileWithPath(item);
@@ -211,11 +211,11 @@ public async static Task<BaseStorageFolder> DangerousGetFolderFromPathAsync
211211
public async static Task<StorageFolderWithPath> DangerousGetFolderWithPathFromPathAsync
212212
(string value, StorageFolderWithPath rootFolder = null, StorageFolderWithPath parentFolder = null)
213213
{
214-
if (rootFolder is not null || parentFolder is not null)
214+
if (rootFolder is not null)
215215
{
216216
var currComponents = GetDirectoryPathComponents(value);
217217

218-
if (rootFolder is not null && rootFolder.Path == value)
218+
if (rootFolder.Path == value)
219219
{
220220
return rootFolder;
221221
}
@@ -231,7 +231,7 @@ public async static Task<StorageFolderWithPath> DangerousGetFolderWithPathFromPa
231231
}
232232
return new StorageFolderWithPath(folder, path);
233233
}
234-
else if (rootFolder is not null && value.IsSubPathOf(rootFolder.Path))
234+
else if (value.IsSubPathOf(rootFolder.Path))
235235
{
236236
var folder = rootFolder.Item;
237237
var path = rootFolder.Path;
@@ -249,7 +249,7 @@ public async static Task<StorageFolderWithPath> DangerousGetFolderWithPathFromPa
249249
: value;
250250
var item = await BaseStorageFolder.GetFolderFromPathAsync(fullPath);
251251

252-
if (parentFolder is not null && parentFolder.Path.IsSubPathOf(value) && parentFolder.Item is IPasswordProtectedItem ppis && item is IPasswordProtectedItem ppid)
252+
if (parentFolder is not null && parentFolder.Item is IPasswordProtectedItem ppis && item is IPasswordProtectedItem ppid)
253253
ppid.Credentials = ppis.Credentials;
254254

255255
return new StorageFolderWithPath(item);

0 commit comments

Comments
 (0)