Skip to content

Commit

Permalink
update validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mazyu36 committed Jul 29, 2024
1 parent 3841404 commit 7f12eec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class RouteCalculator extends RouteCalculatorBase {

constructor(scope: Construct, id: string, props: RouteCalculatorProps = {}) {

if (props.description !== undefined && !Token.isUnresolved(props.description) && props.description.length > 1000) {
if (props.description && !Token.isUnresolved(props.description) && props.description.length > 1000) {
throw new Error(`\`description\` must be between 0 and 1000 characters. Received: ${props.description.length} characters`);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('create a route calculator', () => {
});
});

test('creates geofence collection with empty description', () => {
test('creates a route calculator with empty description', () => {
new RouteCalculator(stack, 'RouteCalculator', { description: '' });

Template.fromStack(stack).hasResourceProperties('AWS::Location::RouteCalculator', {
Expand Down

0 comments on commit 7f12eec

Please sign in to comment.