Skip to content

Commit

Permalink
DynamoDB non-locking map now also returning null on missing item
Browse files Browse the repository at this point in the history
  • Loading branch information
gj0dcsa committed Oct 27, 2024
1 parent 4000cc5 commit fbf9b18
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void setItemValue(String partitionKey, String sortKey, JsonNode value) {

@Override
public JsonNode getItemValue(String partitionKey, String sortKey) {
return JsonToolkit.stringToJsonNode(
AttributeValue attributeValue =
dynamoDbClient
.getItem(
GetItemRequest.builder()
Expand All @@ -46,8 +46,8 @@ public JsonNode getItemValue(String partitionKey, String sortKey) {
.consistentRead(true)
.build())
.item()
.getOrDefault("value", AttributeValue.fromS(""))
.s());
.get("value");
return attributeValue == null ? null : JsonToolkit.stringToJsonNode(attributeValue.s());
}

@Override
Expand Down

0 comments on commit fbf9b18

Please sign in to comment.