Skip to content

Commit e3aaa00

Browse files
committed
incorporated review comments
1 parent 308fda0 commit e3aaa00

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

packages/@aws-cdk/cloudformation-include/lib/cfn-include.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -513,18 +513,19 @@ export class CfnInclude extends core.CfnElement {
513513
const template = new CfnInclude(nestedStack, nestedStackId, this.nestedStacksToInclude[nestedStackId]);
514514

515515
// remove parameters replaced in the child stack from the parent's CloudFormation::Stack resource
516-
const parameters = nestedStackProps.Parameters;
516+
if (nestedStackProps.Parameters) {
517+
const parameters = nestedStackProps.Parameters;
517518

518-
for (const param of Object.keys(parameters)) {
519-
if (template.parametersToReplace[param]) {
520-
delete parameters[param];
519+
for (const param of Object.keys(parameters)) {
520+
if (template.parametersToReplace[param]) {
521+
delete parameters[param];
522+
}
521523
}
522-
}
523524

524-
if (parameters.length === 0) {
525-
delete nestedStackProps.Parameters;
525+
if (parameters.length === 0) {
526+
delete nestedStackProps.Parameters;
527+
}
526528
}
527-
528529
const includedStack: IncludedNestedStack = { stack: nestedStack, includedTemplate: template };
529530
this.nestedStacks[nestedStackId] = includedStack;
530531

0 commit comments

Comments
 (0)