Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.48k stars 4.81k forks source link

[BUG] Exception: System.NullReferenceException: at Azure.Storage.Blobs.Models.GetBlobsAsyncCollection.GetNextPageAsync #43350

Open zhouwangzw opened 7 months ago

zhouwangzw commented 7 months ago

Library name and version

Azure.Storage.Blobs 12.19.1.0

Describe the bug

I got this NRE exception when listing a container by pages

Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Azure.Storage.Blobs.Models.GetBlobsAsyncCollection.GetNextPageAsync(String continuationToken, Nullable1 pageSizeHint, Boolean async, CancellationToken cancellationToken) at Azure.Storage.StorageCollectionEnumerator1.StorageAsyncPageable.AsPages(String continuationToken, Nullable1 pageHintSize)+MoveNext() at Azure.Storage.StorageCollectionEnumerator1.StorageAsyncPageable.AsPages(String continuationToken, Nullable`1 pageHintSize)+System.Threading.Tasks.Sources.IValueTaskSource.GetResult()

Expected behavior

No NRE exception

Actual behavior

NRE exception is thrown

Reproduction Steps

var blobEnumerator = containerClient .GetBlobsAsync( traits: BlobTraits.Metadata, prefix: null, cancellationToken: cancellationToken) .AsPages(default) .ConfigureAwait(false);

await foreach (var page in blobEnumerator) { ..... }

Environment

.NET 6 and .NET 8

github-actions[bot] commented 7 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.