Merge pull request #170 from emrysal/bugfix/crash-when-username-does-not-exist-#144
Check if user exists or return a 404 before proceedingpull/175/head
commit
99ddb8a054
|
@ -356,6 +356,12 @@ export async function getServerSideProps(context) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
return {
|
||||||
|
notFound: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const eventType = await prisma.eventType.findFirst({
|
const eventType = await prisma.eventType.findFirst({
|
||||||
where: {
|
where: {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
|
|
Loading…
Reference in New Issue