Skip to content

Commit

Permalink
PXBF-1770-ajax-http-error: handle node empty
Browse files Browse the repository at this point in the history
  • Loading branch information
gchi25 committed Nov 8, 2024
1 parent 2b70207 commit 89936e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions usagov_benefit_finder/src/Traits/BenefitFinderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 89936e2

Please sign in to comment.