mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 16:41:49 +00:00
fix(cron): validate webhook mode requires URL in resolveFailureDestination
When mode is 'webhook' but no 'to' URL is provided, return null instead of creating an invalid plan that silently fails later.
This commit is contained in:
committed by
Tak Hoffman
parent
099f3c7341
commit
386a60e77d
@@ -156,6 +156,12 @@ export function resolveFailureDestination(
|
||||
}
|
||||
|
||||
const resolvedMode = mode ?? "announce";
|
||||
|
||||
// Webhook mode requires a URL
|
||||
if (resolvedMode === "webhook" && !to) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const result: CronFailureDeliveryPlan = {
|
||||
mode: resolvedMode,
|
||||
channel: resolvedMode === "announce" ? (channel ?? "last") : undefined,
|
||||
|
||||
Reference in New Issue
Block a user