APIv4 - Silently ignore errors in CoreUtil::getInfoItem()
authorColeman Watts <coleman@civicrm.org>
Tue, 10 Aug 2021 22:03:15 +0000 (18:03 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 10 Aug 2021 22:03:15 +0000 (18:03 -0400)
Fixes dev/core#2751

Civi/Api4/Utils/CoreUtil.php

index 7d27b9ea247f5e6a34317dea9e9ccfb50bf5278a..0c9f9612a6558d263f69b9b4f1ccb76e5f78b075 100644 (file)
@@ -60,7 +60,8 @@ class CoreUtil {
    * @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;
   }
 
   /**