fix: remove unnecessary null check

Because `findOneByOrFail` is used above, the null check is unnecessary.
This commit is contained in:
Johann150 2022-05-16 09:14:42 +02:00
parent d92d389cda
commit fc51ac17b1
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -25,10 +25,6 @@ export const paramDef = {
export default define(meta, paramDef, async (ps, me) => {
const report = await AbuseUserReports.findOneByOrFail({ id: ps.reportId });
if (report == null) {
throw new Error('report not found');
}
if (ps.forward && report.targetUserHost != null) {
const actor = await getInstanceActor();
const targetUser = await Users.findOneByOrFail({ id: report.targetUserId });