mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 21:37:34 -07:00
Fix: unknown user cause 500 on AP (#5436)
This commit is contained in:
parent
a942ed1e92
commit
c29c202e11
1 changed files with 3 additions and 3 deletions
|
@ -146,7 +146,7 @@ router.get('/users/:user/publickey', async ctx => {
|
|||
});
|
||||
|
||||
// user
|
||||
async function userInfo(ctx: Router.IRouterContext, user: User) {
|
||||
async function userInfo(ctx: Router.IRouterContext, user: User | undefined) {
|
||||
if (user == null) {
|
||||
ctx.status = 404;
|
||||
return;
|
||||
|
@ -165,7 +165,7 @@ router.get('/users/:user', async (ctx, next) => {
|
|||
const user = await Users.findOne({
|
||||
id: userId,
|
||||
host: null
|
||||
}).then(ensure);
|
||||
});
|
||||
|
||||
await userInfo(ctx, user);
|
||||
});
|
||||
|
@ -176,7 +176,7 @@ router.get('/@:user', async (ctx, next) => {
|
|||
const user = await Users.findOne({
|
||||
usernameLower: ctx.params.user.toLowerCase(),
|
||||
host: null
|
||||
}).then(ensure);
|
||||
});
|
||||
|
||||
await userInfo(ctx, user);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue