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
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()
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, Nullable.GetResult()
1 pageSizeHint, Boolean async, CancellationToken cancellationToken) at Azure.Storage.StorageCollectionEnumerator
1.StorageAsyncPageable.AsPages(String continuationToken, Nullable1 pageHintSize)+MoveNext() at Azure.Storage.StorageCollectionEnumerator
1.StorageAsyncPageable.AsPages(String continuationToken, Nullable`1 pageHintSize)+System.Threading.Tasks.Sources.IValueTaskSourceExpected 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