Prevent error when results are empty

This commit is contained in:
Brian Miyaji
2019-06-20 16:53:55 +10:00
parent befcec07cc
commit b7980fa07d

View File

@@ -541,7 +541,7 @@ class SP_Player_List extends SP_Secondary_Post {
if ( sizeof( $results ) ): if ( sizeof( $results ) ):
foreach ( $results as $id => $team_results ): foreach ( $results as $id => $team_results ):
if ( $team_id == $id ) continue; if ( $team_id == $id ) continue;
$team_results['outcome'] = null; if ( is_array( $team_results ) ):
unset( $team_results['outcome'] ); unset( $team_results['outcome'] );
foreach ( $team_results as $result_slug => $team_result ): foreach ( $team_results as $result_slug => $team_result ):
@@ -553,6 +553,7 @@ class SP_Player_List extends SP_Secondary_Post {
// Add subset // Add subset
$totals[ $player_id ][ $result_slug . 'against' . ( $i + 1 ) ] = $team_result; $totals[ $player_id ][ $result_slug . 'against' . ( $i + 1 ) ] = $team_result;
endforeach; endforeach;
endif;
endforeach; endforeach;
endif; endif;
endif; endif;