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

record.getUserIdentity() #168

Closed
guilhermecvm opened this issue Oct 7, 2020 · 3 comments
Closed

record.getUserIdentity() #168

guilhermecvm opened this issue Oct 7, 2020 · 3 comments

Comments

@guilhermecvm
Copy link

guilhermecvm commented Oct 7, 2020

Hi, trying to convert DynamodbEvent to List<Record>, however when the lambda gets excuted, seems like record.getUserIdentity() returns null, therefore breaking toIdentityV2. Is it the case that the user identity is nullable and a safety check is needed?

fun handleRequest(event: DynamodbEvent, context: Context) {
  DynamodbEventTransformer.toRecordsV2(event)
}
java.lang.NullPointerException
at com.amazonaws.services.lambda.runtime.events.transformers.dynamodb.DynamodbIdentityTransformer.toIdentityV2(DynamodbIdentityTransformer.java:9)
at com.amazonaws.services.lambda.runtime.events.transformers.dynamodb.DynamodbRecordTransformer.toRecordV2(DynamodbRecordTransformer.java:19)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.base/java.util.stream.ReferencePipeline.collect(Unknown Source)
at com.amazonaws.services.lambda.runtime.events.transformers.DynamodbEventTransformer.toRecordsV2(DynamodbEventTransformer.java:19)
@carlzogh
Copy link
Contributor

carlzogh commented Oct 7, 2020

Hey @guilhermecvm, thanks for reporting this!

I've put in a fix for this issue here

@carlzogh
Copy link
Contributor

carlzogh commented Oct 7, 2020

The fix for this was released as part of aws-lambda-java-events-sdk-transformer version 2.0.6 and is now available through Maven https://search.maven.org/artifact/com.amazonaws/aws-lambda-java-events-sdk-transformer/2.0.6/jar

Thanks again!

@carlzogh carlzogh closed this as completed Oct 7, 2020
@guilhermecvm
Copy link
Author

Awesome, that was quick. Thanks @carlzogh

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

No branches or pull requests

2 participants