Resolve Sentry issues
- Add the missing not found check in artifact admin - Add null-checks in TierList's global error handler
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { eq } from "drizzle-orm";
|
||||
import { notFound } from "next/navigation";
|
||||
import Avatar from "@/components/avatar";
|
||||
import {
|
||||
Card,
|
||||
@@ -23,6 +24,7 @@ export default async function AdminSubmissionView({
|
||||
.from(submissions)
|
||||
.where(eq(submissions.id, id))
|
||||
.limit(1);
|
||||
if (!sub) notFound();
|
||||
const [char] = await db
|
||||
.select()
|
||||
.from(characters)
|
||||
|
||||
@@ -129,7 +129,7 @@ export function TierList({
|
||||
useEffect(() => {
|
||||
const handler = (ev: ErrorEvent) =>
|
||||
toast.error("Unexpected Error Occured", {
|
||||
description: `${ev.error.message || ev.error || "*unknown error*"}`,
|
||||
description: `${ev?.error?.message || ev?.error || "*unknown error*"}`,
|
||||
});
|
||||
window.addEventListener("error", handler);
|
||||
return () => window.removeEventListener("error", handler);
|
||||
|
||||
Reference in New Issue
Block a user