Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NPE when generationNotMatch fails #731

Copy link
Copy link
Closed
@dimo414

Description

@dimo414
Issue body actions

The following:

bucket.create("file", new byte[0], "text/plain");
Blob blob = bucket.get("file");
bucket.storage().create(blob, new byte[0], BlobTargetOption.generationNotMatch());

Causes a:

com.google.gcloud.storage.StorageException: java.lang.NullPointerException
    at com.google.gcloud.storage.StorageException.translateAndThrow(StorageException.java:74)
    at com.google.gcloud.storage.StorageImpl.create(StorageImpl.java:150)
    at com.google.gcloud.storage.StorageImpl.create(StorageImpl.java:129)
    ...

The translateAndThrow() call suppresses the underlying stack trace, but this shouldn't trigger an NPE. I do expect it to fail, but it should fail with a meaningful error message.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.