Null check for blog

This commit is contained in:
Damian Mooyman 2019-10-15 17:02:44 +13:00
parent 283f65880d
commit 3772496f18
No known key found for this signature in database
GPG Key ID: 19B1752E86A700BB
1 changed files with 6 additions and 3 deletions

View File

@ -124,7 +124,8 @@ trait BlogObject
return $extended;
}
return $this->Blog()->canView($member);
$blog = $this->Blog();
return $blog && $blog->canView($member);
}
/**
@ -158,7 +159,8 @@ trait BlogObject
return $extended;
}
return $this->Blog()->canDelete($member);
$blog = $this->Blog();
return $blog && $blog->canDelete($member);
}
/**
@ -176,7 +178,8 @@ trait BlogObject
return $extended;
}
return $this->Blog()->canEdit($member);
$blog = $this->Blog();
return $blog && $blog->canEdit($member);
}
protected function onBeforeWrite()