Index: trunk/extensions/Contest/Contest.hooks.php |
— | — | @@ -205,15 +205,17 @@ |
206 | 206 | |
207 | 207 | $contestantIds = array(); |
208 | 208 | |
209 | | - foreach ( $contestants as $contestant ) { |
210 | | - $contestantIds[] = $contestant->contestant_id; |
| 209 | + if ( count( $contestants ) > 0 ) { |
| 210 | + foreach ( $contestants as $contestant ) { |
| 211 | + $contestantIds[] = $contestant->contestant_id; |
| 212 | + } |
| 213 | + |
| 214 | + ContestContestant::s()->update( |
| 215 | + array( 'email' => $email ), |
| 216 | + array( 'id' => $contestantIds ) |
| 217 | + ); |
211 | 218 | } |
212 | 219 | |
213 | | - ContestContestant::s()->update( |
214 | | - array( 'email' => $email ), |
215 | | - array( 'id' => $contestantIds ) |
216 | | - ); |
217 | | - |
218 | 220 | return true; |
219 | 221 | } |
220 | 222 | |