fix (backend): fix condition
This commit is contained in:
parent
02101e04dc
commit
195701d297
1 changed files with 11 additions and 5 deletions
|
@ -44,8 +44,11 @@ export async function scheduledNote(
|
||||||
})
|
})
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const reply = await Notes.findOneBy({ id: job.data.option.replyId });
|
const reply =
|
||||||
if (reply == null) {
|
job.data.option.replyId != null
|
||||||
|
? await Notes.findOneBy({ id: job.data.option.replyId })
|
||||||
|
: undefined;
|
||||||
|
if (job.data.option.replyId != null && reply == null) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`Note ${job.data.option.replyId} (reply) does not exist, aborting`,
|
`Note ${job.data.option.replyId} (reply) does not exist, aborting`,
|
||||||
);
|
);
|
||||||
|
@ -53,10 +56,13 @@ export async function scheduledNote(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const renote = await Notes.findOneBy({ id: job.data.option.renoteId });
|
const renote =
|
||||||
if (renote == null) {
|
job.data.option.renoteId != null
|
||||||
|
? await Notes.findOneBy({ id: job.data.option.renoteId })
|
||||||
|
: undefined;
|
||||||
|
if (job.data.option.renoteId != null && renote == null) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`Note ${job.data.option.replyId} (renote) does not exist, aborting`,
|
`Note ${job.data.option.renoteId} (renote) does not exist, aborting`,
|
||||||
);
|
);
|
||||||
done();
|
done();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue