mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
Null check for blog
This commit is contained in:
parent
283f65880d
commit
3772496f18
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user