Skip to content

NPE on "isTruncated" with s3, using local stack #253

@matanshukry

Description

@matanshukry

In what version(s) of Spring Integration AWS are you seeing this issue?

3.0.9

Describe the bug

Calling S3InboundFileSynchronizer.synchronizeToLocalDirectory(file) when my app starts - and it ends up with NPE and the app crashes.

Also using localstack, installed using brew latest, and set up in the app through
aws.endpointUrlS3 = http://localhost:4566 (intellij override configuration properties)

To Reproduce

Described above.

Expected behavior

Not have an NPE

Sample

Can't provide it at the moment, hopefully the other information is enough.

** Notes **

Looking at the stack trace, I can clearly see the issue:
in S3Session object, list method, there is a call to isTruncated.
The return value of that method is Boolean (hence nullable), however it is treated as a primitive and when null is returned, an NPE is thrown.

Reference: https://github.com/spring-projects/spring-integration-aws/blob/main/src/main/java/org/springframework/integration/aws/support/S3Session.java#L88

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions