Index: ldapdata.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ldap_integration/ldapdata.module,v
retrieving revision 1.15.2.11
diff -u -r1.15.2.11 ldapdata.module
--- ldapdata.module	12 Aug 2008 22:21:11 -0000	1.15.2.11
+++ ldapdata.module	19 Dec 2008 20:11:31 -0000
@@ -351,16 +351,18 @@
   $allowed_attrs = _ldapdata_ldap_info($user, 'ldapdata_roattrs');
   $items = array();
   $i = 0;
-  foreach ($ldapdata_attributes as $attr_name => $attr_info) {
-    if (in_array($attr_name, $allowed_attrs)) {
-      $item = array(
-        '#type' => 'user_profile_item',
-        '#title' => $attr_info[2],
-        '#value' => theme('ldapdata_ldap_attribute', $entry[strtolower($attr_name)][0], $attr_info[0]),
-        '#weight' => $i++,
-      );
-      $items[$attr_name] = $item;
-    }
+  if (is_array($allowed_attrs)) {
+	  foreach ($ldapdata_attributes as $attr_name => $attr_info) {
+		if (in_array($attr_name, $allowed_attrs)) {
+		  $item = array(
+			'#type' => 'user_profile_item',
+			'#title' => $attr_info[2],
+			'#value' => theme('ldapdata_ldap_attribute', $entry[strtolower($attr_name)][0], $attr_info[0]),
+			'#weight' => $i++,
+		  );
+		  $items[$attr_name] = $item;
+		}
+	  }
   }
   if (!empty($items)) {
     $user->content[t(LDAPDATA_PROFILE)] = array_merge(array(
