From 1afe0437237a7bc2db9a534a3407718a120e93c8 Mon Sep 17 00:00:00 2001 From: hjpalpha <75081997+hjpalpha@users.noreply.github.com> Date: Tue, 7 Jan 2025 09:12:18 +0100 Subject: [PATCH] fix(match2): missing nil catch in submatch check (#5285) fix(match2): catch nil in submatch check --- .../commons/starcraft_starcraft2/match_group_util_starcraft.lua | 2 +- components/match2/wikis/stormgate/match_group_util_custom.lua | 2 +- components/match2/wikis/warcraft/match_group_util_custom.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua b/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua index 939d7b1401..f8f04075a9 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua @@ -190,7 +190,7 @@ end function StarcraftMatchGroupUtil.constructSubmatch(games, match) local firstGame = games[1] local opponents = Table.deepCopy(firstGame.opponents) - local isSubmatch = String.startsWith(firstGame.map, 'Submatch') + local isSubmatch = String.startsWith(firstGame.map or '', 'Submatch') if isSubmatch then games = {firstGame} end diff --git a/components/match2/wikis/stormgate/match_group_util_custom.lua b/components/match2/wikis/stormgate/match_group_util_custom.lua index e0677dad53..dfe3a7d013 100644 --- a/components/match2/wikis/stormgate/match_group_util_custom.lua +++ b/components/match2/wikis/stormgate/match_group_util_custom.lua @@ -184,7 +184,7 @@ end function CustomMatchGroupUtil.constructSubmatch(games, match) local firstGame = games[1] local opponents = Table.deepCopy(firstGame.opponents) - local isSubmatch = String.startsWith(firstGame.map, 'Submatch') + local isSubmatch = String.startsWith(firstGame.map or '', 'Submatch') if isSubmatch then games = {firstGame} end diff --git a/components/match2/wikis/warcraft/match_group_util_custom.lua b/components/match2/wikis/warcraft/match_group_util_custom.lua index 6239838ec4..596bb9bef9 100644 --- a/components/match2/wikis/warcraft/match_group_util_custom.lua +++ b/components/match2/wikis/warcraft/match_group_util_custom.lua @@ -176,7 +176,7 @@ end function CustomMatchGroupUtil.constructSubmatch(games, match) local firstGame = games[1] local opponents = Table.deepCopy(firstGame.opponents) - local isSubmatch = String.startsWith(firstGame.map, 'Submatch') + local isSubmatch = String.startsWith(firstGame.map or '', 'Submatch') if isSubmatch then games = {firstGame} end