diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpAuthSchemePlugin.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpAuthSchemePlugin.java index e575b66a3ca..be8e48de5c0 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpAuthSchemePlugin.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/auth/http/integration/AddHttpAuthSchemePlugin.java @@ -8,6 +8,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import software.amazon.smithy.codegen.core.Symbol; import software.amazon.smithy.model.knowledge.ServiceIndex; @@ -187,11 +188,13 @@ private static void identityProviderConfigProvider(TypeScriptWriter w, ); w.openCollapsibleBlock(""" new DefaultIdentityProviderConfig({""", "})", - httpAuthSchemes.values().stream().anyMatch(scheme -> - scheme.getConfigFields().stream().anyMatch( - field -> field.type().equals(ConfigField.Type.MAIN) - ) - ), + httpAuthSchemes.values().stream() + .filter(Objects::nonNull) + .anyMatch(scheme -> + scheme.getConfigFields().stream().anyMatch( + field -> field.type().equals(ConfigField.Type.MAIN) + ) + ), () -> { for (HttpAuthScheme scheme : httpAuthSchemes.values()) { if (scheme == null) {