diff --git a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java index 2de540f02..299ff5fda 100644 --- a/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java +++ b/codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java @@ -637,7 +637,7 @@ public TypeConverter generateUnionConverter(final UnionShape unionShape) { .of("if (value.Is%sSet)".formatted(propertyName)); } else if (listTypes.contains(propertyName)) { checkIfValuePresent = TokenTree - .of("if (!value.%s.Any())".formatted(propertyName)); + .of("if (value.%s.Any())".formatted(propertyName)); } else if ("NULL".equals(propertyName)) { checkIfValuePresent = TokenTree .of("if (value.%s == true)".formatted(propertyName));