Skip to content

Commit f70ef52

Browse files
fix: for not found
1 parent dd00934 commit f70ef52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pages/bots/[id]/edit.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const ManageBotPage: NextPage<ManageBotProps> = ({ bot, user, csrfToken, theme }
5858
else return null
5959
}
6060

61-
if (!bot) return <NotFound />
61+
if (!bot?.id) return <NotFound />
6262
if (!user)
6363
return (
6464
<Login>
@@ -618,10 +618,10 @@ export const getServerSideProps = async (ctx: Context) => {
618618
const parsed = parseCookie(ctx.req)
619619
const user = await get.Authorization(parsed?.token)
620620
const bot = await get.bot.load(ctx.query.id)
621-
const spec = await get.botSpec(bot?.id, user || '')
621+
const spec = await get.botSpec(bot?.id || '', user || '')
622622
return {
623623
props: {
624-
bot: { ...bot, banner: spec?.banner, bg: spec?.bg },
624+
bot: { ...bot, banner: spec?.banner || null, bg: spec?.bg || null },
625625
user: await get.user.load(user || ''),
626626
csrfToken: getToken(ctx.req, ctx.res),
627627
},

0 commit comments

Comments
 (0)