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:
Dreamgineer
2026-01-18 16:05:01 +07:00 Unverified
parent c1d02d8e3f
commit 627f0bdf86
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -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)
+1 -1
View File
@@ -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);