Skip to content

Commit

Permalink
Merge pull request #21084 from colemanw/fixGetInfoItem
Browse files Browse the repository at this point in the history
APIv4 - Silently ignore errors in CoreUtil::getInfoItem()
  • Loading branch information
eileenmcnaughton authored Aug 10, 2021
2 parents 1198660 + 0014160 commit cfbd5db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Civi/Api4/Utils/CoreUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public static function getApiClass($entityName) {
* @return mixed
*/
public static function getInfoItem(string $entityName, string $keyToReturn) {
return self::getApiClass($entityName)::getInfo()[$keyToReturn] ?? NULL;
$className = self::getApiClass($entityName);
return $className ? $className::getInfo()[$keyToReturn] ?? NULL : NULL;
}

/**
Expand Down

0 comments on commit cfbd5db

Please sign in to comment.