Skip to content

Commit 18ef731

Browse files
muhammad-othmanashovlin
authored andcommitted
update DynamoDBEntryConversion.TryFromEntry to make it more readable
1 parent 338c7d3 commit 18ef731

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

sdk/src/Services/DynamoDBv2/Custom/Conversion/DynamoDBEntryConversion.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -571,14 +571,17 @@ public bool TryFromEntry(DynamoDBEntry entry, Type targetType, out object value)
571571

572572
var d = entry as Document;
573573
if (d != null && TryFrom(d, targetType, out value))
574-
return true;
575-
576-
value = null;
577-
578-
var n = entry as DynamoDBNull;
574+
return true;
575+
576+
var n = entry as DynamoDBNull;
579577
if (n != null)
580-
return true;
581-
578+
{
579+
value = null;
580+
return true;
581+
}
582+
583+
// Could not convert entry to a known type, setting value to null as it's an out parameter
584+
value = null;
582585
return false;
583586
}
584587

0 commit comments

Comments
 (0)