mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-12 20:57:45 +02:00
Fix value.every is not a function (#10213)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
@@ -256,8 +256,12 @@ async function getValueCollaborators (value: any, attr: AnyAttribute, control: T
|
||||
if (arrOf._class === core.class.RefTo) {
|
||||
const to = (arrOf as RefTo<Doc>).to
|
||||
if (hierarchy.isDerived(to, contact.class.Person)) {
|
||||
if (!Array.isArray(value)) {
|
||||
control.ctx.error('Expected array but got non-array value when getting value collaborators', { attr, value })
|
||||
return []
|
||||
}
|
||||
if (value.length === 0) return []
|
||||
if ((value as any[]).every((it) => it === null)) {
|
||||
if (value.every((it) => it === null)) {
|
||||
control.ctx.error('Null-values array of person refs when getting value collaborators', { attr, value })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user