Commit 3e21daf2 authored by WalkingDexter's avatar WalkingDexter Committed by atymchuk

Check for the existence of a view display in ViewsUrlGenerator::processDataSet().

parent 4b02c50e
......@@ -173,9 +173,16 @@ class ViewsUrlGenerator extends EntityUrlGeneratorBase {
try {
// Trying to get an instance of the view.
$view = Views::getView($view_id);
if (empty($view) || !$view->setDisplay($display_id)) {
if (empty($view)) {
throw new \UnexpectedValueException('Failed to get an instance of the view.');
}
// Trying to set the view display.
$view->initDisplay();
if (!$view->displayHandlers->has($display_id) || !$view->setDisplay($display_id)) {
throw new \UnexpectedValueException('Failed to set the view display.');
}
// Trying to get the sitemap settings.
$settings = $this->sitemapViews->getSitemapSettings($view);
if (empty($settings)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment