Skip to content

Commit f432dd6

Browse files
committed
Fix validation of counter in scg configs
1 parent 050acc5 commit f432dd6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

client/src/scg.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ export function validateScgConfig(data: ScgConfigSchema): boolean {
174174
// Validate counters
175175
if (data.counters) {
176176
for (const counter of data.counters) {
177-
if (typeof counter.name !== 'string' || typeof counter.value !== 'number') return false;
177+
if (typeof counter.name !== 'string') return false;
178+
if (counter.value && typeof counter.value !== 'number') return false;
178179
}
179180
}
180181

0 commit comments

Comments
 (0)