SummitEntityEvent Error

Fixed null pointer exception on
getOwnerID method

Change-Id: I249bc0d459275872c745ec0c9cdd6caab83e929c
This commit is contained in:
Sebastian Marcet 2018-05-21 16:10:04 -03:00
parent 852a8bf33e
commit 25d2d2d467
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ class SummitEntityEvent extends SilverstripeBaseModel
*/
public function getOwnerId(){
try{
return $this->owner->getId();
return is_null($this->owner) ? 0 : $this->owner->getId();
}
catch(\Exception $ex){
return 0;