From bede9c184f1a5b18849713f7c8823e0832b935d6 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Sat, 4 Jul 2026 00:03:58 +0500 Subject: [PATCH] fix: handle missing card in CreateToDo function (#10952) Signed-off-by: Denis Bykhov --- server-plugins/process-resources/src/functions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server-plugins/process-resources/src/functions.ts b/server-plugins/process-resources/src/functions.ts index d4ae95ac34..e14b37d168 100644 --- a/server-plugins/process-resources/src/functions.ts +++ b/server-plugins/process-resources/src/functions.ts @@ -791,7 +791,9 @@ export async function CreateToDo ( const todoResults = results ?? [] if (params.askRequired === true) { const h = control.client.getHierarchy() - const classId = _process.masterTag + const card = control.cache.get(execution.card) + if (card === undefined) throw processError(process.error.ObjectNotFound, { _id: execution.card }) + const classId = h.isMixin(_process.masterTag) ? _process.masterTag : h.getBaseClass(card._class) const allAttributes = Array.from( h.isMixin(classId) ? h.getOwnAttributes(classId).values() : h.getAllAttributes(classId, core.class.Doc).values() )