fix 500 on room create

This commit is contained in:
not-nullptr 2024-03-19 18:41:57 +00:00
parent 4edc443fdb
commit bad3d07e6f
2 changed files with 2 additions and 2 deletions

View file

@ -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(),
),
};
}

View file

@ -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"),