Prevent error on event page
This commit is contained in:
@@ -178,8 +178,11 @@ class SP_Event extends SP_Custom_Post{
|
|||||||
if ( ! is_array( $players ) ) continue;
|
if ( ! is_array( $players ) ) continue;
|
||||||
|
|
||||||
foreach ( $players as $player => $player_performance ):
|
foreach ( $players as $player => $player_performance ):
|
||||||
|
if ( ! is_array( $player_performance ) ) continue;
|
||||||
|
|
||||||
// Prepare existing values for equation calculation
|
// Prepare existing values for equation calculation
|
||||||
$vars = $player_performance;
|
$vars = $player_performance;
|
||||||
|
|
||||||
foreach ( $vars as $key => $var ):
|
foreach ( $vars as $key => $var ):
|
||||||
if ( empty( $var ) ) $vars[ $key ] = 0;
|
if ( empty( $var ) ) $vars[ $key ] = 0;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
Reference in New Issue
Block a user