From 39e2c58c3c95dba85134a4a63433512dca8d3aec Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 10 Apr 2010 13:52:39 +0200 Subject: [PATCH] Fix warning when a profile has no promo. Signed-off-by: Florent Bruneau --- classes/profile.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/profile.php b/classes/profile.php index c2cb842..5ad9c54 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -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() -- 2.1.4