Skip to content

Commit 9a4d394

Browse files
waleedlatif1claude
andcommitted
fix(cloudwatch): use Number.isFinite to also reject Infinity in block config
Aligns block-level validation with route's Zod .finite() refinement so Infinity/-Infinity are caught at the block config layer, not just the API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1118e4f commit 9a4d394

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/blocks/blocks/cloudwatch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,8 +571,8 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
571571
throw new Error('Metric value is required')
572572
}
573573
const numericValue = Number(rest.metricValue)
574-
if (Number.isNaN(numericValue)) {
575-
throw new Error('Metric value must be a valid number')
574+
if (!Number.isFinite(numericValue)) {
575+
throw new Error('Metric value must be a finite number')
576576
}
577577

578578
return {

0 commit comments

Comments
 (0)