diff --git a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php index 0fca07e..270ed26 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Block/ViewsBlock.php @@ -74,13 +74,16 @@ public function form($form, &$form_state) { * {@inheritdoc} */ public function build() { - $output = $this->view->executeDisplay($this->displayID); - // Set the label to the title configured in the view. - $this->configuration['label'] = Xss::filterAdmin($this->view->getTitle()); - // Before returning the block output, convert it to a renderable array - // with contextual links. - $this->addContextualLinks($output); - return $output; + if ($output = $this->view->executeDisplay($this->displayID)) { + // Set the label to the title configured in the view. + $this->configuration['label'] = Xss::filterAdmin($this->view->getTitle()); + // Before returning the block output, convert it to a renderable array + // with contextual links. + $this->addContextualLinks($output); + return $output; + } + + return array(); } /** diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php index 1e59e22..25c387e 100644 --- a/core/modules/views/lib/Drupal/views/ViewExecutable.php +++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php @@ -1333,7 +1333,7 @@ public function render($display_id = NULL) { public function executeDisplay($display_id = NULL, $args = array()) { if (empty($this->current_display) || $this->current_display != $this->chooseDisplay($display_id)) { if (!$this->setDisplay($display_id)) { - return FALSE; + return NULL; } }