mirror of
https://github.com/jonom/silverstripe-betternavigator.git
synced 2024-10-22 14:05:51 +02:00
Check if dataRecord is a SiteTree to prevent errors
This commit is contained in:
parent
8fedcf0c21
commit
90ae32dc51
@ -26,7 +26,7 @@ class BetterNavigator extends DataExtension {
|
||||
$isDev = Director::isDev();
|
||||
|
||||
if($isDev || Permission::check('CMS_ACCESS_CMSMain') || Permission::check('VIEW_DRAFT_CONTENT')) {
|
||||
if($this->owner && $this->owner->dataRecord) {
|
||||
if($this->owner && $this->owner->dataRecord && $this->owner->dataRecord instanceof SiteTree) {
|
||||
|
||||
//Get SilverStripeNavigator links & stage info (CMS/Stage/Live/Archive)
|
||||
$nav = array();
|
||||
|
Loading…
Reference in New Issue
Block a user