Fix warning when a profile has no promo.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 10 Apr 2010 11:52:39 +0000 (13:52 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 10 Apr 2010 11:52:39 +0000 (13:52 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/profile.php

index c2cb842..5ad9c54 100644 (file)
@@ -197,7 +197,11 @@ class Profile
 
     public function mainEducation()
     {
-        return $this->promo{0};
+        if (empty($this->promo)) {
+            return null;
+        } else {
+            return $this->promo{0};
+        }
     }
 
     public function mainEducationDuration()