From 4fb7c4d6daa28586fbacb9086632525abd49c683 Mon Sep 17 00:00:00 2001 From: Valentin Kaelin Date: Mon, 31 Jan 2022 23:09:39 +0100 Subject: [PATCH] fix: forgot to check length in one spot --- client/src/store/modules/summoner.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/store/modules/summoner.js b/client/src/store/modules/summoner.js index 5c9ce75..defe23e 100644 --- a/client/src/store/modules/summoner.js +++ b/client/src/store/modules/summoner.js @@ -87,7 +87,9 @@ export const mutations = { OVERVIEW_FOUND(state, infos) { state.basic.recentActivity = infos.stats.recentActivity state.overview.matches = infos.matches - state.overview.lastMatchId = infos.matches[infos.matches.length - 1].matchId + if (infos.matches.length > 0) { + state.overview.lastMatchId = infos.matches[infos.matches.length - 1].matchId + } state.overview.stats = infos.stats state.overview.loaded = true state.records.recordsLoaded = false