Added checks for valid array keys. CRM-12464
authorAS <as@dell12.(none)>
Tue, 30 Apr 2013 04:33:41 +0000 (21:33 -0700)
committerColeman Watts <coleman@civicrm.org>
Wed, 29 May 2013 21:32:22 +0000 (14:32 -0700)
----------------------------------------
* CRM-12464:
  http://issues.civicrm.org/jira/browse/CRM-12464

CRM/Core/PseudoConstant.php

index 4c551a6c702a504d66298ef88dfc904e9e641dad..b219ec42e4e73e8cc22cae7d329ebc70f9a48da9 100644 (file)
@@ -412,6 +412,9 @@ class CRM_Core_PseudoConstant {
   public static function get($daoName, $fieldName, $params = array()) {
     $dao = new $daoName;
     $fields = $dao->fields();
+    if (empty($fields[$fieldName])) {
+      return FALSE;
+    }
     $fieldSpec = $fields[$fieldName];
 
     // If the field is an enum, use explode the enum definition and return the array.