fixes #1879 – race condition in websockets service

This commit is contained in:
Tom Moor
2021-02-22 21:53:20 -08:00
parent 2195787e7d
commit cd7cbab5ac

View File

@ -369,6 +369,10 @@ export default class Websockets {
method: ["withMembership", event.userId], method: ["withMembership", event.userId],
}).findByPk(collectionGroup.collectionId); }).findByPk(collectionGroup.collectionId);
if (!collection) {
continue;
}
const hasMemberships = const hasMemberships =
collection.memberships.length > 0 || collection.memberships.length > 0 ||
collection.collectionGroupMemberships.length > 0; collection.collectionGroupMemberships.length > 0;