From a1ca500ea378909f73fa23a25fc1e9ffe4dac686 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Mon, 23 Mar 2015 22:01:36 +1100 Subject: [PATCH] Check that players exist when calculating player statistics --- includes/class-sp-player.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index 67c46404..48d9a873 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -5,7 +5,7 @@ * The SportsPress player class handles individual player data. * * @class SP_Player - * @version 1.7 + * @version 1.7.3 * @package SportsPress/Classes * @category Class * @author ThemeBoy @@ -184,7 +184,7 @@ class SP_Player extends SP_Custom_Post { // Add all team performance foreach ( $team_performance as $team_id => $players ): - if ( array_key_exists( $this->ID, $players ) ): + if ( is_array( $players ) && array_key_exists( $this->ID, $players ) ): $player_performance = sp_array_value( $players, $this->ID, array() );