commit 82e7d24b337e88ed9a34758d70e15f9ae2e61a5e Author: smarcet Date: Wed Oct 14 11:43:13 2020 -0300 Fix on null condition Change-Id: If9e0c628fbf1336d1a41328f78fc2ac62c700f70 Signed-off-by: smarcet diff --git a/app/Models/Foundation/Summit/Summit.php b/app/Models/Foundation/Summit/Summit.php index 8127e46..1af4043 100644 --- a/app/Models/Foundation/Summit/Summit.php +++ b/app/Models/Foundation/Summit/Summit.php @@ -4955,10 +4955,12 @@ SQL; * @return array|DateTime[] */ public function getSummitDays():array { - if(is_null($this->begin_date)) return []; - if(is_null($this->end_date)) return []; - $beginDate = $this->getLocalBeginDate()->setTime(0,0,0); - $endDate = $this->getLocalEndDate()->setTime(0,0,0); + $beginDate = $this->getLocalBeginDate(); + $endDate = $this->getLocalEndDate(); + if(is_null($beginDate)) return []; + if(is_null($endDate)) return []; + $beginDate = $beginDate->setTime(0,0,0); + $endDate = $endDate->setTime(0,0,0); $res = []; $res[] = clone $beginDate; while($beginDate < $endDate){