From 352f7fc9581c10ff953e5a31e16b6decb75e330f Mon Sep 17 00:00:00 2001 From: Jeremy Skinner Date: Wed, 28 Mar 2018 09:34:16 +0100 Subject: [PATCH 1/2] Null check in contacts_views_post_render --- contacts.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contacts.module b/contacts.module index 88f5a7f..784f0a1 100644 --- a/contacts.module +++ b/contacts.module @@ -534,7 +534,7 @@ function contacts_preprocess_views_view_unformatted(&$variables) { * Implements hook_views_post_render(). */ function contacts_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) { - if ($output['#view']->id() == 'contacts_dashboard_indexed') { + if (isset($output['#view']) && $output['#view']->id() == 'contacts_dashboard_indexed') { $output['#attached']['library'][] = 'contacts/listings'; } } From cd15efdc06cb4d545c8721f4c67f23d500a6f158 Mon Sep 17 00:00:00 2001 From: Jeremy Skinner Date: Wed, 28 Mar 2018 10:01:51 +0100 Subject: [PATCH 2/2] Use array_key_exists instead --- contacts.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contacts.module b/contacts.module index 784f0a1..217d758 100644 --- a/contacts.module +++ b/contacts.module @@ -534,7 +534,7 @@ function contacts_preprocess_views_view_unformatted(&$variables) { * Implements hook_views_post_render(). */ function contacts_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) { - if (isset($output['#view']) && $output['#view']->id() == 'contacts_dashboard_indexed') { + if (array_key_exists('#view', $output) && $output['#view']->id() == 'contacts_dashboard_indexed') { $output['#attached']['library'][] = 'contacts/listings'; } }