Skip to content

Commit a8a4b90

Browse files
Fix value.every is not a function (#10213)
Signed-off-by: Artem Savchenko <armisav@gmail.com>
1 parent 02fa0f4 commit a8a4b90

File tree

1 file changed

+5
-1
lines changed
  • server-plugins/notification-resources/src

1 file changed

+5
-1
lines changed

server-plugins/notification-resources/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,12 @@ async function getValueCollaborators (value: any, attr: AnyAttribute, control: T
256256
if (arrOf._class === core.class.RefTo) {
257257
const to = (arrOf as RefTo<Doc>).to
258258
if (hierarchy.isDerived(to, contact.class.Person)) {
259+
if (!Array.isArray(value)) {
260+
control.ctx.error('Expected array but got non-array value when getting value collaborators', { attr, value })
261+
return []
262+
}
259263
if (value.length === 0) return []
260-
if ((value as any[]).every((it) => it === null)) {
264+
if (value.every((it) => it === null)) {
261265
control.ctx.error('Null-values array of person refs when getting value collaborators', { attr, value })
262266
}
263267

0 commit comments

Comments
 (0)