From 89936e25c7d261a99a701542cc862c0ba036cdbf Mon Sep 17 00:00:00 2001 From: gchi25 Date: Fri, 8 Nov 2024 14:42:52 -0500 Subject: [PATCH] PXBF-1770-ajax-http-error: handle node empty --- usagov_benefit_finder/src/Traits/BenefitFinderTrait.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usagov_benefit_finder/src/Traits/BenefitFinderTrait.php b/usagov_benefit_finder/src/Traits/BenefitFinderTrait.php index c7c66b94..b509b47e 100644 --- a/usagov_benefit_finder/src/Traits/BenefitFinderTrait.php +++ b/usagov_benefit_finder/src/Traits/BenefitFinderTrait.php @@ -161,6 +161,10 @@ public function getLifeEventForm($nid, $mode) { public function getNode($nid, $mode) { $node = Node::load($nid); + if (!$node) { + return NULL; + } + if ($node->hasField('moderation_state')) { $moderation_state = $node->get('moderation_state')->value; if ($moderation_state == 'archived') {