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:
Bailey Pumfleet
2021-05-07 20:40:42 +01:00
committed by GitHub
+6
View File
@@ -356,6 +356,12 @@ export async function getServerSideProps(context) {
}
});
if (!user) {
return {
notFound: true,
}
}
const eventType = await prisma.eventType.findFirst({
where: {
userId: user.id,