Index: trunk/extensions/Contest/includes/Contest.class.php |
— | — | @@ -409,8 +409,11 @@ |
410 | 410 | $contestantIds[] = $contestant->getId(); |
411 | 411 | } |
412 | 412 | |
413 | | - $success = ContestComment::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success; |
414 | | - $success = ContestVote::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success; |
| 413 | + if ( count( $contestantIds ) > 0 ) { |
| 414 | + $success = ContestComment::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success; |
| 415 | + $success = ContestVote::s()->delete( array( 'contestant_id' => $contestantIds ) ) && $success; |
| 416 | + } |
| 417 | + |
415 | 418 | $success = ContestContestant::s()->delete( $condition ) && $success; |
416 | 419 | } |
417 | 420 | |