diff --git a/src/lib/server/class/Room.ts b/src/lib/server/class/Room.ts index e2b8d59..2a03a8b 100644 --- a/src/lib/server/class/Room.ts +++ b/src/lib/server/class/Room.ts @@ -54,7 +54,7 @@ export class Room { owner: this.host.username, port: parseInt(parsed[1]), game: globalData.games.find( - (g) => g.name.toUpperCase().trim() === config.gameName.toUpperCase().trim(), + (g) => g.name?.toUpperCase().trim() === config.gameName?.toUpperCase().trim(), ), }; } diff --git a/src/routes/blog/+layout.server.ts b/src/routes/blog/+layout.server.ts index ddd65ad..4b07a63 100644 --- a/src/routes/blog/+layout.server.ts +++ b/src/routes/blog/+layout.server.ts @@ -24,7 +24,7 @@ export async function load({ request }) { .split(".md") .slice(0, -1) .join(".md") - .replace(/^\w/gm, (c) => c.toUpperCase()); + .replace(/^\w/gm, (c) => c?.toUpperCase()); // remove title from contents return { contents: contents.split("\n").slice(1).join("\n"),