fix: async error in backlinks service when dealing with a deleted document
This commit is contained in:
parent
b93a397ab3
commit
dd7436f78c
@ -55,7 +55,9 @@ export default class Backlinks {
|
|||||||
await Promise.all(
|
await Promise.all(
|
||||||
addedLinkIds.map(async (linkId) => {
|
addedLinkIds.map(async (linkId) => {
|
||||||
const linkedDocument = await Document.findByPk(linkId);
|
const linkedDocument = await Document.findByPk(linkId);
|
||||||
if (linkedDocument.id === event.documentId) return;
|
if (!linkedDocument || linkedDocument.id === event.documentId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await Backlink.findOrCreate({
|
await Backlink.findOrCreate({
|
||||||
where: {
|
where: {
|
||||||
|
Reference in New Issue
Block a user