Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against NullPointerException for null Item.lastModified. #1605

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hwaite
Copy link

@hwaite hwaite commented Dec 21, 2024

Avert exception:

java.lang.NullPointerException: Cannot invoke "io.minio.messages.ResponseDate.zonedDateTime()" because "this.lastModified" is null.

Null values occur when doing a non-recursive, prefixed 'listObjects' call.

@@ -86,7 +87,9 @@ public String objectName() {

/** Returns last modified time of the object. */
public ZonedDateTime lastModified() {
return lastModified.zonedDateTime();
return Optional.ofNullable(lastModified)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hwaite I suspect a server bug. Please share the reproducer along with your object storage server information.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1606.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants