From f1577701b2e4a5a0a5c478fdd8eb7352be676316 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 13 Jan 2017 09:05:54 +1100 Subject: [PATCH] Prevent error on event page --- includes/class-sp-event.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-sp-event.php b/includes/class-sp-event.php index 476bafb3..53c672c6 100644 --- a/includes/class-sp-event.php +++ b/includes/class-sp-event.php @@ -178,8 +178,11 @@ class SP_Event extends SP_Custom_Post{ if ( ! is_array( $players ) ) continue; foreach ( $players as $player => $player_performance ): + if ( ! is_array( $player_performance ) ) continue; + // Prepare existing values for equation calculation $vars = $player_performance; + foreach ( $vars as $key => $var ): if ( empty( $var ) ) $vars[ $key ] = 0; endforeach;