diff --git a/src/routes/wish/_excelImport.svelte b/src/routes/wish/_excelImport.svelte index b3d27033..256c6fc2 100644 --- a/src/routes/wish/_excelImport.svelte +++ b/src/routes/wish/_excelImport.svelte @@ -44,9 +44,11 @@ let oldest = dayjs().year(2200); if (data !== null) { - newest = dayjs(data.pulls[data.pulls.length - 1].time); - oldest = dayjs(data.pulls[0].time); - pulls = data.pulls; + if (data.pulls.length > 0) { + newest = dayjs(data.pulls[data.pulls.length - 1].time); + oldest = dayjs(data.pulls[0].time); + pulls = data.pulls; + } } return { @@ -230,7 +232,7 @@ 'character-event': 'Character Event Wish', 'weapon-event': 'Weapon Event Wish', standard: 'Permanent Wish', - beginners: "Novice Wishes", + beginners: 'Novice Wishes', }; const weapons = Object.values(weaponList);