From f73d65dc8fb1d9f3ce38114fd1deb604c0705a7c Mon Sep 17 00:00:00 2001 From: Made Baruna Date: Wed, 20 Dec 2023 11:38:52 +0800 Subject: [PATCH] Fix character build load if doesnt exist --- src/routes/characters/[id].svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/routes/characters/[id].svelte b/src/routes/characters/[id].svelte index 30226ec7..0f784724 100644 --- a/src/routes/characters/[id].svelte +++ b/src/routes/characters/[id].svelte @@ -233,9 +233,12 @@ onMount(async () => { const buildHash = window.location.hash.substring(1); - const foundBuild = builds.findIndex((e) => e.name.replace(/[ /]/g, '_').toLowerCase() === buildHash); - if (foundBuild > -1) { - currentBuild = foundBuild; + + if (builds) { + const foundBuild = builds.findIndex((e) => e.name.replace(/[ /]/g, '_').toLowerCase() === buildHash); + if (foundBuild > -1) { + currentBuild = foundBuild; + } } await getConstellationCount();