Skip to content

Commit 46617eb

Browse files
Try getting a single item/page to check whether directory exists
1 parent fbbecc7 commit 46617eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Umbraco.StorageProviders.AzureBlob/IO/AzureBlobFileSystem.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ public bool DirectoryExists(string path)
128128
{
129129
ArgumentNullException.ThrowIfNull(path);
130130

131-
return ListBlobs(path).Any();
131+
// Try getting a single item/page
132+
Page<BlobHierarchyItem>? firstPage = ListBlobs(path).AsPages(pageSizeHint: 1).FirstOrDefault();
133+
134+
return firstPage?.Values.Count > 0;
132135
}
133136

134137
/// <inheritdoc />

0 commit comments

Comments
 (0)