Skip to content

Commit

Permalink
Merge pull request #27360 from colemanw/pseudoconstantGuard-5.64
Browse files Browse the repository at this point in the history
PseudoConstant - Prevent fatal when entity not available
  • Loading branch information
eileenmcnaughton authored Sep 7, 2023
2 parents eb19c34 + 36b2dec commit 8efb42a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CRM/Core/PseudoConstant.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ public static function get($daoName, $fieldName, $params = [], $context = NULL)
}

// Core field: load schema
$dao = new $daoName();
$fieldSpec = $dao->getFieldSpec($fieldName);
if (class_exists($daoName)) {
$dao = new $daoName();
$fieldSpec = $dao->getFieldSpec($fieldName);
}

// Return false if field doesn't exist.
if (empty($fieldSpec)) {
Expand Down

0 comments on commit 8efb42a

Please sign in to comment.