From 90894c2e390052c949ea5d85d6959503d671ef61 Mon Sep 17 00:00:00 2001 From: Anthony Malkoun Date: Wed, 6 Jan 2021 17:47:21 +1100 Subject: [PATCH] Check that $node is properly populated before continuing Some routes that have a 'node' parameter don't necessarily hydrate the parameter, e.g. /node/$nid/revisions/$vid/revert --- .../tide_site_preview/src/Plugin/Block/PreviewLinksBlock.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/tide_site_preview/src/Plugin/Block/PreviewLinksBlock.php b/modules/tide_site_preview/src/Plugin/Block/PreviewLinksBlock.php index 3de2470..70d421c 100644 --- a/modules/tide_site_preview/src/Plugin/Block/PreviewLinksBlock.php +++ b/modules/tide_site_preview/src/Plugin/Block/PreviewLinksBlock.php @@ -235,6 +235,11 @@ protected function getCurrentNode() : ?NodeInterface { $node = NULL; } } + + if (!($node instanceof NodeInterface)) { + $node = NULL; + } + $this->currentNode = $node; return $this->currentNode;