mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 09:45:24 -04:00
fix: manage_tasks create handles an explicit null prompt without crashing (#1290)
This commit is contained in:
@@ -892,7 +892,9 @@ async def do_manage_tasks(content: str, owner: Optional[str] = None) -> Dict:
|
||||
)
|
||||
|
||||
task_id = str(_uuid.uuid4())
|
||||
name = args.get("name") or args.get("prompt", args.get("action_name", "Task"))[:50]
|
||||
# Guard each fallback with `or`: args.get("prompt", default) returns
|
||||
# None when the key is present but null, and None[:50] raises.
|
||||
name = args.get("name") or (args.get("prompt") or args.get("action_name") or "Task")[:50]
|
||||
|
||||
task = ScheduledTask(
|
||||
id=task_id,
|
||||
|
||||
Reference in New Issue
Block a user