diff --git a/src/server/api/endpoints/notes/create.ts b/src/server/api/endpoints/notes/create.ts index 955cdbdf7..feab8990c 100644 --- a/src/server/api/endpoints/notes/create.ts +++ b/src/server/api/endpoints/notes/create.ts @@ -235,6 +235,12 @@ export const meta = { code: 'CANNOT_RENOTE_DUE_TO_VISIBILITY', id: 'be9529e9-fe72-4de0-ae43-0b363c4938af', }, + + noSuchFile: { + message: 'Some files are not found.', + code: 'NO_SUCH_FILE', + id: 'b6992544-63e7-67f0-fa7f-32444b1b5306', + }, } }; @@ -254,6 +260,9 @@ export default define(meta, async (ps, user) => { userId: user.id }) ))).filter(file => file != null) as DriveFile[]; + if (files.length !== fileIds.length) { + throw new ApiError(meta.errors.noSuchFile); + } } let renote: Note | undefined;