mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 15:34:31 +00:00
Cron: guard missing expr in schedule parsing
This commit is contained in:
@@ -41,7 +41,11 @@ export function computeNextRunAtMs(schedule: CronSchedule, nowMs: number): numbe
|
||||
return anchor + steps * everyMs;
|
||||
}
|
||||
|
||||
const expr = schedule.expr.trim();
|
||||
const exprSource = (schedule as { expr?: unknown }).expr;
|
||||
if (typeof exprSource !== "string") {
|
||||
throw new Error("invalid cron schedule: expr is required");
|
||||
}
|
||||
const expr = exprSource.trim();
|
||||
if (!expr) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user