diff --git a/core/modules/views/src/Plugin/Block/ViewsBlock.php b/core/modules/views/src/Plugin/Block/ViewsBlock.php index 46e0069..f12f626 100644 --- a/core/modules/views/src/Plugin/Block/ViewsBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsBlock.php @@ -25,18 +25,19 @@ public function build() { $this->view->display_handler->preBlockBuild($this); $args = []; - foreach ($this->view->display_handler->getHandlers('argument') as $argument_name => $argument) { - /** @var \Drupal\views\Plugin\views\argument\ArgumentPluginBase $argument */ - $args[$argument_name] = NULL; - if (!empty($this->context[$argument_name])) { - if (($value = $this->context[$argument_name]->getContextValue())) { - if ($value instanceof EntityInterface) { - $value = $value->id(); + if ($this->view->display_handler->getHandlers('argument')) { + foreach ($this->view->display_handler->getHandlers('argument') as $argument_name => $argument) { + /** @var \Drupal\views\Plugin\views\argument\ArgumentPluginBase $argument */ + $args[$argument_name] = NULL; + if (!empty($this->context[$argument_name])) { + if (($value = $this->context[$argument_name]->getContextValue())) { + if ($value instanceof EntityInterface) { + $value = $value->id(); + } + $args[$argument_name] = $value; + } elseif ($argument->options['default_action'] == 'ignore') { + $args[$argument_name] = $argument->options['exception']['value']; } - $args[$argument_name] = $value; - } - elseif ($argument->options['default_action'] == 'ignore') { - $args[$argument_name] = $argument->options['exception']['value']; } } }