diff --git a/php/libraries/Candidate.class.inc b/php/libraries/Candidate.class.inc index d1a653492f4..a09209b6a6c 100644 --- a/php/libraries/Candidate.class.inc +++ b/php/libraries/Candidate.class.inc @@ -627,7 +627,7 @@ class Candidate $where = array('cid' => $candID); $result = $db->pselectCol($query, $where); - return is_array($result) ? array_shift($result) : ''; + return (is_array($result) && count($result) > 0) ? array_shift($result) : ''; } /**