Skip to content

Commit

Permalink
fix(match2): missing nil catch, missing passalong on sc and sg (#5163)
Browse files Browse the repository at this point in the history
fix(match2): missing nil catch, missing passalong
  • Loading branch information
hjpalpha authored Dec 4, 2024
1 parent 9185577 commit c146900
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function StarcraftMatchGroupUtil.computeGameOpponents(game, matchOpponents)

return Array.map(game.opponents, function(mapOpponent, opponentIndex)
local mode = modeParts[opponentIndex]
local players = Array.map(mapOpponent.players, function(player, playerIndex)
local players = Array.map(mapOpponent.players or {}, function(player, playerIndex)
if Logic.isEmpty(player) then return end
local matchPlayer = (matchOpponents[opponentIndex].players or {})[playerIndex] or {}
return Table.merge({displayName = 'TBD'}, matchPlayer, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function MatchMapsTeamLegacy._handleMaps()
mapWinner = _match2Args[prefix .. 'win']

if map or mapWinner then
_match2Args['map' .. gameIndex] = MatchMapsTeamLegacy._processSingleMap(prefix, map, mapWinner)
_match2Args['map' .. gameIndex] = MatchMapsTeamLegacy._processSingleMap(prefix, map, mapWinner, gameIndex)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ end
---@return WarcraftMatchGroupUtilGameOpponent[]
function CustomMatchGroupUtil.computeGameOpponents(game, matchOpponents)
return Array.map(game.opponents, function(mapOpponent, opponentIndex)
local players = Array.map(mapOpponent.players, function(player, playerIndex)
local players = Array.map(mapOpponent.players or {}, function(player, playerIndex)
if Logic.isEmpty(player) then return end
local matchPlayer = (matchOpponents[opponentIndex].players or {})[playerIndex] or {}
return Table.merge({displayName = 'TBD'}, matchPlayer, {
Expand Down

0 comments on commit c146900

Please sign in to comment.