diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index 072296c2..f540be05 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -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 ): diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index 7c17b10a..46553cc1 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -411,6 +411,7 @@ class SP_Player extends SP_Custom_Post { $totals['eventminutes'] -= sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $this->ID ), 'sub' ), 0, 0 ); else: foreach ( $timeline as $timeline_team => $timeline_players ): + if ( ! is_array( $timeline_players ) ) continue; foreach ( $timeline_players as $timeline_player => $timeline_performance ): if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $this->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 );