From a786a95844b28aaaff7c28dc95b0de594c6d8978 Mon Sep 17 00:00:00 2001 From: "Kamat, Trivikram" <16024985+trivikr@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:40:27 +0000 Subject: [PATCH] fix: pass empty hash to getRuntimeConfig if undefined --- .../typescript/codegen/ServiceBareBonesClientGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGenerator.java b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGenerator.java index 825f6d761d3..4c13f9019ab 100644 --- a/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGenerator.java +++ b/smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/ServiceBareBonesClientGenerator.java @@ -340,7 +340,7 @@ private void generateConstructor() { writer.pushState(CLIENT_CONSTRUCTOR_SECTION); int configVariable = 0; - writer.write("let $L = __getRuntimeConfig(configuration);", + writer.write("let $L = __getRuntimeConfig(configuration || {});", generateConfigVariable(configVariable)); if (service.hasTrait(EndpointRuleSetTrait.class)) {