Merge pull request #170 from emrysal/bugfix/crash-when-username-does-not-exist-#144
Check if user exists or return a 404 before proceeding
This commit is contained in:
commit
99ddb8a054
1 changed files with 6 additions and 0 deletions
|
@ -356,6 +356,12 @@ export async function getServerSideProps(context) {
|
|||
}
|
||||
});
|
||||
|
||||
if (!user) {
|
||||
return {
|
||||
notFound: true,
|
||||
}
|
||||
}
|
||||
|
||||
const eventType = await prisma.eventType.findFirst({
|
||||
where: {
|
||||
userId: user.id,
|
||||
|
|
Loading…
Reference in a new issue