Skip to content

Commit

Permalink
type safety
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Dec 12, 2024
1 parent 84c5dc8 commit 521ba74
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions components/match2/commons/match_summary_base_ffa.lua
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ local MATCH_OVERVIEW_COLUMNS = {
class = 'cell--match-points',
icon = 'matchpoint',
show = function(match)
return match.extradata.settings.matchPointThreshold
return (match.extradata.settings or {}).matchPointThreshold
end,
header = {
value = 'MPe Game',
Expand All @@ -161,7 +161,7 @@ local MATCH_OVERVIEW_COLUMNS = {
local GAME_OVERVIEW_COLUMNS = {
{
show = function(match)
return match.extradata.settings.showGameDetails
return (match.extradata.settings or {}).showGameDetails
end,
class = 'panel-table__cell__game-placement',
icon = 'placement',
Expand Down Expand Up @@ -191,7 +191,7 @@ local GAME_OVERVIEW_COLUMNS = {
},
{
show = function(match)
if match.extradata.settings.showGameDetails == false then
if (match.extradata.settings or {}).showGameDetails == false then
return false
end
return Table.any(match.extradata.placementinfo or {}, function(_, value)
Expand All @@ -211,7 +211,7 @@ local GAME_OVERVIEW_COLUMNS = {
},
{
show = function(match)
return not match.extradata.settings.showGameDetails
return not (match.extradata.settings or {}).showGameDetails
end,
class = 'panel-table__cell__game-total-points',
icon = 'points',
Expand Down Expand Up @@ -551,7 +551,7 @@ function MatchSummaryFfa.updateMatchOpponents(match)
end)
end)

local matchPointThreshold = match.extradata.settings.matchPointThreshold
local matchPointThreshold = (match.extradata.settings or {}).matchPointThreshold
if matchPointThreshold then
Array.forEach(match.opponents, function(opponent)
local matchPointReachedIn
Expand Down

0 comments on commit 521ba74

Please sign in to comment.