diff --git a/web/src/utils/user.ts b/web/src/utils/user.ts index c2d8769f..4edaee3b 100644 --- a/web/src/utils/user.ts +++ b/web/src/utils/user.ts @@ -1,5 +1,5 @@ import { User, User_Role } from "@/types/proto/api/v1/user_service"; -export const isSuperUser = (user: User) => { - return user.role === User_Role.ADMIN || user.role === User_Role.HOST; +export const isSuperUser = (user: User | undefined) => { + return user && (user.role === User_Role.ADMIN || user.role === User_Role.HOST); };