CRM-14999 - Fix notice on Online Registration screen
authoratif-shaikh <shaikh388@gmail.com>
Thu, 17 Jul 2014 08:03:26 +0000 (13:33 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Thu, 17 Jul 2014 08:03:26 +0000 (13:33 +0530)
https://issues.civicrm.org/jira/browse/CRM-14999

CRM/Utils/Array.php

index af0900da1e12e71fe8cf363b082d477612d39bd7..34b18aba5f35058ad54a5bcb478c379a34c56159 100644 (file)
@@ -737,11 +737,13 @@ class CRM_Utils_Array {
    */
   static function collect($prop, $records) {
     $result = array();
-    foreach ($records as $key => $record) {
-      if (is_object($record)) {
-        $result[$key] = $record->{$prop};
-      } else {
-        $result[$key] = $record[$prop];
+    if (is_array($records)) {
+      foreach ($records as $key => $record) {
+        if (is_object($record)) {
+          $result[$key] = $record->{$prop};
+        } else {
+          $result[$key] = $record[$prop];
+        }
       }
     }
     return $result;