Skip to content

Commit

Permalink
fix the fixme.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored and abronan committed Apr 27, 2020
1 parent 0f5d334 commit 896c0ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions store/dynamodb/dynamodb.go
Expand Up @@ -415,8 +415,9 @@ func (ddb *DynamoDB) AtomicDelete(key string, previous *store.KVPair) (bool, err
}

expAttr := make(map[string]*dynamodb.AttributeValue)
// FIXME previous.LastIndex may lead to a nil pointer dereference
expAttr[":lastRevision"] = &dynamodb.AttributeValue{N: aws.String(strconv.FormatUint(previous.LastIndex, 10))}
if previous != nil {
expAttr[":lastRevision"] = &dynamodb.AttributeValue{N: aws.String(strconv.FormatUint(previous.LastIndex, 10))}
}

req := &dynamodb.DeleteItemInput{
TableName: aws.String(ddb.tableName),
Expand Down

0 comments on commit 896c0ef

Please sign in to comment.