Skip to content

Commit 5a23fd0

Browse files
authored
chore: validate that logicalId is always a string (#1072)
1 parent 6249ef2 commit 5a23fd0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/cli/src/constructs/project.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ export class Session {
235235
}
236236

237237
static validateCreateConstruct (construct: Construct) {
238+
if (typeof construct.logicalId !== 'string') {
239+
throw new ValidationError(`The "logicalId" of a construct must be a string (logicalId=${construct.logicalId} [${typeof construct.logicalId}])`)
240+
}
241+
238242
if (!/^[A-Za-z0-9_\-/#.]+$/.test(construct.logicalId)) {
239243
throw new ValidationError(`The "logicalId" can only include the following characters: [A-Za-z0-9_-/#.]. (logicalId='${construct.logicalId}')`)
240244
}

0 commit comments

Comments
 (0)