@@ -157,7 +157,7 @@ public async static Task<BaseStorageFile> DangerousGetFileFromPathAsync
157
157
public async static Task < StorageFileWithPath > DangerousGetFileWithPathFromPathAsync
158
158
( string value , StorageFolderWithPath rootFolder = null , StorageFolderWithPath parentFolder = null )
159
159
{
160
- if ( rootFolder is not null || parentFolder is not null )
160
+ if ( rootFolder is not null )
161
161
{
162
162
var currComponents = GetDirectoryPathComponents ( value ) ;
163
163
@@ -175,7 +175,7 @@ public async static Task<StorageFileWithPath> DangerousGetFileWithPathFromPathAs
175
175
path = PathNormalization . Combine ( path , file . Name ) ;
176
176
return new StorageFileWithPath ( file , path ) ;
177
177
}
178
- else if ( rootFolder is not null && value . IsSubPathOf ( rootFolder . Path ) )
178
+ else if ( value . IsSubPathOf ( rootFolder . Path ) )
179
179
{
180
180
var folder = rootFolder . Item ;
181
181
var path = rootFolder . Path ;
@@ -195,7 +195,7 @@ public async static Task<StorageFileWithPath> DangerousGetFileWithPathFromPathAs
195
195
: value ;
196
196
var item = await BaseStorageFile . GetFileFromPathAsync ( fullPath ) ;
197
197
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 )
199
199
ppid . Credentials = ppis . Credentials ;
200
200
201
201
return new StorageFileWithPath ( item ) ;
@@ -211,11 +211,11 @@ public async static Task<BaseStorageFolder> DangerousGetFolderFromPathAsync
211
211
public async static Task < StorageFolderWithPath > DangerousGetFolderWithPathFromPathAsync
212
212
( string value , StorageFolderWithPath rootFolder = null , StorageFolderWithPath parentFolder = null )
213
213
{
214
- if ( rootFolder is not null || parentFolder is not null )
214
+ if ( rootFolder is not null )
215
215
{
216
216
var currComponents = GetDirectoryPathComponents ( value ) ;
217
217
218
- if ( rootFolder is not null && rootFolder . Path == value )
218
+ if ( rootFolder . Path == value )
219
219
{
220
220
return rootFolder ;
221
221
}
@@ -231,7 +231,7 @@ public async static Task<StorageFolderWithPath> DangerousGetFolderWithPathFromPa
231
231
}
232
232
return new StorageFolderWithPath ( folder , path ) ;
233
233
}
234
- else if ( rootFolder is not null && value . IsSubPathOf ( rootFolder . Path ) )
234
+ else if ( value . IsSubPathOf ( rootFolder . Path ) )
235
235
{
236
236
var folder = rootFolder . Item ;
237
237
var path = rootFolder . Path ;
@@ -249,7 +249,7 @@ public async static Task<StorageFolderWithPath> DangerousGetFolderWithPathFromPa
249
249
: value ;
250
250
var item = await BaseStorageFolder . GetFolderFromPathAsync ( fullPath ) ;
251
251
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 )
253
253
ppid . Credentials = ppis . Credentials ;
254
254
255
255
return new StorageFolderWithPath ( item ) ;
0 commit comments