Skip to content

Commit 6e7d222

Browse files
authored
fix(codegen): filter null auth schemes (#1804)
1 parent bbdb091 commit 6e7d222

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpAuthSchemePlugin.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.Iterator;
99
import java.util.List;
1010
import java.util.Map;
11+
import java.util.Objects;
1112
import java.util.stream.Collectors;
1213
import software.amazon.smithy.codegen.core.Symbol;
1314
import software.amazon.smithy.model.knowledge.ServiceIndex;
@@ -187,11 +188,13 @@ private static void identityProviderConfigProvider(TypeScriptWriter w,
187188
);
188189
w.openCollapsibleBlock("""
189190
new DefaultIdentityProviderConfig({""", "})",
190-
httpAuthSchemes.values().stream().anyMatch(scheme ->
191-
scheme.getConfigFields().stream().anyMatch(
192-
field -> field.type().equals(ConfigField.Type.MAIN)
193-
)
194-
),
191+
httpAuthSchemes.values().stream()
192+
.filter(Objects::nonNull)
193+
.anyMatch(scheme ->
194+
scheme.getConfigFields().stream().anyMatch(
195+
field -> field.type().equals(ConfigField.Type.MAIN)
196+
)
197+
),
195198
() -> {
196199
for (HttpAuthScheme scheme : httpAuthSchemes.values()) {
197200
if (scheme == null) {

0 commit comments

Comments
 (0)