summary refs log tree commit diff
path: root/util/src/entities/User.ts
diff options
context:
space:
mode:
Diffstat (limited to 'util/src/entities/User.ts')
-rw-r--r--util/src/entities/User.ts4
1 files changed, 1 insertions, 3 deletions
diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts
index 4c86b2d8..b5c2c308 100644
--- a/util/src/entities/User.ts
+++ b/util/src/entities/User.ts
@@ -161,15 +161,13 @@ export class User extends BaseClass {
 	}
 
 	static async getPublicUser(user_id: string, opts?: FindOneOptions<User>) {
-		const user = await User.findOne(
+		return await User.findOneOrFail(
 			{ id: user_id },
 			{
 				...opts,
 				select: [...PublicUserProjection, ...(opts?.select || [])],
 			}
 		);
-		if (!user) throw new HTTPError("User not found", 404);
-		return user;
 	}
 }