Skip to content

Commit

Permalink
change if conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Sep 13, 2023
1 parent 96151c8 commit 4cb8339
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export class GaugeWidget extends ConcreteWidget {
this.metrics = props.metrics ?? [];
this.copyMetricWarnings(...this.metrics);

if (props.end && !props.start) {
if (props.end !== undefined && props.start === undefined) {
throw new Error('You must specify a start if you specify an end');
}
}
Expand Down Expand Up @@ -435,7 +435,7 @@ export class GraphWidget extends ConcreteWidget {
this.rightMetrics = props.right ?? [];
this.copyMetricWarnings(...this.leftMetrics, ...this.rightMetrics);

if (props.end && !props.start) {
if (props.end !== undefined && props.start === undefined) {
throw new Error('You must specify a start if you specify an end');
}
}
Expand Down Expand Up @@ -573,7 +573,7 @@ export class SingleValueWidget extends ConcreteWidget {
throw new Error('You cannot use setPeriodToTimeRange with sparkline');
}

if (props.end && !props.start) {
if (props.end !== undefined && props.start === undefined) {
throw new Error('You must specify a start if you specify an end');
}
}
Expand Down

0 comments on commit 4cb8339

Please sign in to comment.