From ce60955f37bb2e2874cdcbd9370969d42a1408aa Mon Sep 17 00:00:00 2001 From: baz Date: Fri, 25 Apr 2025 17:56:46 +0100 Subject: [PATCH] Extra error checking --- commands/100-games/wrapped.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/commands/100-games/wrapped.js b/commands/100-games/wrapped.js index 4e55ec4..65b5df3 100644 --- a/commands/100-games/wrapped.js +++ b/commands/100-games/wrapped.js @@ -259,9 +259,11 @@ async function GetFavouriteGenres() { const genres = []; const counts = []; for (let i = 0; i < beatGameIGDBEntries.length; i++) { - for (let j = 0; j < beatGameIGDBEntries[i].genres.length; j++) { - const genre = await getGenres(beatGameIGDBEntries[i].genres[j]); - genres.push(genre); + if (beatGameIGDBEntries[i].genres) { + for (let j = 0; j < beatGameIGDBEntries[i].genres.length; j++) { + const genre = await getGenres(beatGameIGDBEntries[i].genres[j]); + genres.push(genre); + } } }