Azure / azure-storage-java

Microsoft Azure Storage Library for Java
https://docs.microsoft.com/en-us/java/api/overview/azure/storage
MIT License
189 stars 165 forks source link

NPE in BlockBlobClient.exists #575

Open ohadbitt opened 1 year ago

ohadbitt commented 1 year ago

Which service(blob, file, queue, table) does this issue concern?

blob

Which version of the SDK was used?

com.azure:azure-storage-blob:12.18.0 (bom 1.2.4)

What problem was encountered?

NPE in BlockBlobClient.exists

Have you found a mitigation/solution?

Kind of - i actually go to this from getBlobOutputStream, so passing overwrite=true fixed the issue for me

Caused by: java.lang.NullPointerException at com.azure.storage.blob.specialized.BlobClientBase.exists(BlobClientBase.java:405) at com.azure.storage.blob.specialized.BlockBlobClient.getBlobOutputStream(BlockBlobClient.java:148) at com.azure.storage.blob.specialized.BlockBlobClient.getBlobOutputStream(BlockBlobClient.java:132) ... 70 more

From debugging existsWithResponse(null, Context.NONE) -> returns null Then call to existsWithResponse(null, Context.NONE).getValue() -> is NPE The blob shouldnt exist at that point btw