Alternator icon indicating copy to clipboard operation
Alternator copied to clipboard

NPE is thrown when updating with AttributeValueUpdate without action

Open nefilim opened this issue 12 years ago • 1 comments

v0.6.4

com.amazonaws.AmazonServiceException: Caught java.lang.NullPointerException (null) at com.michelboudreau.alternator.AlternatorDBHandler.updateItem line 991

This does not happen when running the same code against a AWS DynamoDB, I was under the impression one does not have to specify an action:

updateItems.put("NewAttribute", new AttributeValueUpdate() .withValue(new AttributeValue().withS("Some Value")));

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LowLevelJavaCRUDExample.html

nefilim avatar Sep 04 '13 18:09 nefilim

Hm, interesting. Alternator is lacking a bit behind some of Amazon's changes. As I don't use Alternator currently for a project, it's been hard to keep up. Thanks for bringing this to my attention.

The best way to fix it is to put a failing test that explain your problem exactly, which shouldn't take you long since you already have the failing code. Hopefully, someone will eventually fix this issue, but I would definitely recommend that you try your hand at fixing it. I can't speak for others, but my schedule is already fairly busy and it might take me a while to get to this problem.

With that said, I'm always available to lend an ear if you don't understand something.

Cheers.

mboudreau avatar Sep 05 '13 00:09 mboudreau