Fix empty timeline error when calculating substitution time

This commit is contained in:
Brian Miyaji
2017-01-12 19:57:40 +11:00
parent e2be7d7ec7
commit 3b4c916851
2 changed files with 2 additions and 0 deletions

View File

@@ -327,6 +327,7 @@ class SP_Player_List extends SP_Custom_Post {
else:
foreach ( $timeline as $timeline_team => $timeline_players ):
foreach ( $timeline_players as $timeline_player => $timeline_performance ):
if ( ! is_array( $timeline_performance ) ) continue;
if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $player_id === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
if ( $substitution_time ):