fix: handle missing card in CreateToDo function (#10952)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov
2026-07-04 00:03:58 +05:00
committed by GitHub
parent 8541588be8
commit bede9c184f
@@ -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()
)