From 1207df285f1ea86dd73b472ad42929f0d156f080 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 1 Jun 2020 11:48:55 +0100 Subject: [PATCH] Fix undefined index notice on non-node pages Fixes #95 --- web/themes/custom/opdavies/opdavies.theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/themes/custom/opdavies/opdavies.theme b/web/themes/custom/opdavies/opdavies.theme index c5fcb18..a270343 100644 --- a/web/themes/custom/opdavies/opdavies.theme +++ b/web/themes/custom/opdavies/opdavies.theme @@ -12,7 +12,7 @@ use Drupal\custom\Entity\Node\Post; */ function opdavies_preprocess_page(array &$variables): void { /** @var \Drupal\custom\Entity\Node\Post $node */ - if (!$node = $variables['node']) { + if (!$node = $variables['node'] ?? NULL) { return; }