Index: profile_role.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/profile_role/profile_role.module,v
retrieving revision 1.5.2.3
diff -u -p -r1.5.2.3 profile_role.module
--- profile_role.module	19 Jan 2010 05:18:01 -0000	1.5.2.3
+++ profile_role.module	28 Apr 2010 04:08:12 -0000
@@ -155,7 +155,8 @@ function profile_role_restrict_form_subm
   db_query('DELETE FROM {profile_role}');
 
   foreach ($form_state['values']['_categories'] as $key => $category) {
-    foreach ($form_state['values'][$key]['roles'] as $rid) {
+    $roles = array_filter($form_state['values'][$key]['roles']);
+    foreach ($roles as $rid) {
       db_query("INSERT INTO {profile_role}
                 VALUES (%d, '%s')", $rid, $category);
     }
@@ -174,7 +175,7 @@ function profile_role_get_roles() {
                       FROM {profile_role}');
   $roles = array();
   while ($role = db_fetch_object($result)) {
-    $roles[$role->category][] = $role->rid;
+    $roles[$role->category][$role->rid] = $role->rid;
   }
   return $roles;
 }
