diff --git a/src/app/player/[id]/page.tsx b/src/app/player/[id]/page.tsx index 0c3380f..6cf1f54 100644 --- a/src/app/player/[id]/page.tsx +++ b/src/app/player/[id]/page.tsx @@ -14,7 +14,7 @@ type Params = { export async function generateMetadata({ params: { id } }: Params): Promise { const player = await getData(id); - if (!player) { + if (player == null) { return generateEmbed({ title: "Unknown Player", description: "Player not found" }); } diff --git a/src/app/server/[platform]/[hostname]/page.tsx b/src/app/server/[platform]/[hostname]/page.tsx index 034c3f9..f90224a 100644 --- a/src/app/server/[platform]/[hostname]/page.tsx +++ b/src/app/server/[platform]/[hostname]/page.tsx @@ -19,7 +19,7 @@ type Params = { export async function generateMetadata({ params: { platform, hostname } }: Params): Promise { const server = await getData(platform, hostname); - if (!server) { + if (server == null) { return generateEmbed({ title: "Unknown Server", description: "Server not found" }); } @@ -27,8 +27,8 @@ export async function generateMetadata({ params: { platform, hostname } }: Param let favicon = null; // Server favicon + // Java specific if (platform === ServerPlatform.Java) { - // Java specific const javaServer = server as JavaMinecraftServer; favicon = javaServer.favicon && javaServer.favicon.url; } @@ -60,8 +60,8 @@ export default async function Page({ params: { platform, hostname } }: Params) { let favicon = null; // Server favicon - if (platform === ServerPlatform.Java) { - // Java specific + // Java specific + if (server && platform === ServerPlatform.Java) { const javaServer = server as JavaMinecraftServer; favicon = javaServer.favicon && javaServer.favicon.url; }