diff --git a/service/ddb/constraint.go b/service/ddb/constraint.go index 062e17c..59d5f7b 100644 --- a/service/ddb/constraint.go +++ b/service/ddb/constraint.go @@ -396,7 +396,9 @@ func maybeConditionExpression[T dynamo.Thing]( } } - *conditionExpression = aws.String(strings.Join(seq, " and ")) + if len(seq) > 0 { + *conditionExpression = aws.String(strings.Join(seq, " and ")) + } // Unfortunately empty maps are not accepted by DynamoDB if len(expressionAttributeNames) == 0 { @@ -429,7 +431,9 @@ func maybeUpdateConditionExpression[T dynamo.Thing]( } } - *conditionExpression = aws.String(strings.Join(seq, " and ")) + if len(seq) > 0 { + *conditionExpression = aws.String(strings.Join(seq, " and ")) + } // Unfortunately empty maps are not accepted by DynamoDB if len(expressionAttributeNames) == 0 {