From d5e6a79c8a0f9be2602407e3a65f95473f43b134 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 19 Sep 2021 18:01:27 -0300 Subject: [PATCH] Extra check to Achievements --- src/views/achievements/reducers/AchievementsReducer.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/achievements/reducers/AchievementsReducer.tsx b/src/views/achievements/reducers/AchievementsReducer.tsx index 8ae9f004..6f8e2b11 100644 --- a/src/views/achievements/reducers/AchievementsReducer.tsx +++ b/src/views/achievements/reducers/AchievementsReducer.tsx @@ -48,7 +48,8 @@ export const AchievementsReducer: Reducer 0) { selectedCategoryName = categories[0].name; - selectedAchievementId = categories[0].achievements[0].achievementId; + + if(categories[0].achievements.length > 0) selectedAchievementId = categories[0].achievements[0].achievementId; } return { ...state, categories, selectedCategoryName, selectedAchievementId };