Skip to content

Commit 54d2ca9

Browse files
committed
fix ConvertToSdkAttribute mapping for empty lists
1 parent 6a2b41a commit 54d2ca9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Libraries/src/Amazon.Lambda.DynamoDBEvents.SDK.Convertor/DynamodbAttributeValueConvertor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ public static Amazon.DynamoDBv2.Model.AttributeValue ConvertToSdkAttribute(this
4343
sdkAttribute.B = lambdaAttribute.B;
4444

4545
// String Set
46-
else if (lambdaAttribute.SS != null && lambdaAttribute.SS.Count > 0)
46+
else if (lambdaAttribute.SS != null)
4747
sdkAttribute.SS = new List<string>(lambdaAttribute.SS);
4848

4949
// Number Set
50-
else if (lambdaAttribute.NS != null && lambdaAttribute.NS.Count > 0)
50+
else if (lambdaAttribute.NS != null)
5151
sdkAttribute.NS = new List<string>(lambdaAttribute.NS);
5252

5353
// Binary Set
54-
else if (lambdaAttribute.BS != null && lambdaAttribute.BS.Count > 0)
54+
else if (lambdaAttribute.BS != null)
5555
sdkAttribute.BS = lambdaAttribute.BS;
5656

5757
// List
58-
else if (lambdaAttribute.L != null && lambdaAttribute.L.Count > 0)
58+
else if (lambdaAttribute.L != null)
5959
{
6060
sdkAttribute.L = new List<Amazon.DynamoDBv2.Model.AttributeValue>();
6161
foreach (var item in lambdaAttribute.L)
@@ -65,7 +65,7 @@ public static Amazon.DynamoDBv2.Model.AttributeValue ConvertToSdkAttribute(this
6565
}
6666

6767
// Map
68-
else if (lambdaAttribute.M != null && lambdaAttribute.M.Count > 0)
68+
else if (lambdaAttribute.M != null)
6969
{
7070
sdkAttribute.M = new Dictionary<string, Amazon.DynamoDBv2.Model.AttributeValue>();
7171
foreach (var kvp in lambdaAttribute.M)

0 commit comments

Comments
 (0)