Skip to content

Commit d6a9427

Browse files
committed
Fix empty string bug
1 parent 879075e commit d6a9427

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/DynamoDBGenerator/Internal/MarshallHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static AttributeValue FromNullableNumberSet<T>(IEnumerable<T?> numbers, s
5959
return new AttributeValue { NS = [] };
6060

6161
var list = new List<string?>(count);
62-
list.AddRange(numbers.Select(x => x.ToString()));
62+
list.AddRange(numbers.Select(x => x.ToString()).Where(x => string.IsNullOrEmpty(x) is false));
6363

6464
return new AttributeValue { NS = list };
6565
}

tests/DynamoDBGenerator.SourceGenerator.Tests/DynamoDBDocumentTests/Marshaller/Asserters/MarshalAsserter.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ public void Marshall_IsEquivalentTo_UnmarshallResult()
3333
public void UnMarshall_IsEquivalentTo_MarshallResult()
3434
{
3535
Arguments().Should().AllSatisfy(x =>
36-
MarshallImplementation(UnmarshallImplementation(x.attributeValues)).Should()
37-
.BeEquivalentTo(x.attributeValues));
36+
{
37+
var unmarshallImplementation = UnmarshallImplementation(x.attributeValues);
38+
var marshallImplementation = MarshallImplementation(unmarshallImplementation);
39+
marshallImplementation.Should().BeEquivalentTo(x.attributeValues);
40+
});
3841
}
3942

4043
[Fact]

0 commit comments

Comments
 (0)