From ecc63dd6171fea9dc4cc1c4826c2b5c68b5ebc2d Mon Sep 17 00:00:00 2001
From: AS <as@dell12.(none)>
Date: Mon, 29 Apr 2013 21:33:41 -0700
Subject: [PATCH] Added checks for valid array keys. CRM-12464

----------------------------------------
* CRM-12464:
  http://issues.civicrm.org/jira/browse/CRM-12464
---
 CRM/Core/PseudoConstant.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/CRM/Core/PseudoConstant.php b/CRM/Core/PseudoConstant.php
index 4c551a6c70..b219ec42e4 100644
--- a/CRM/Core/PseudoConstant.php
+++ b/CRM/Core/PseudoConstant.php
@@ -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.
-- 
GitLab