Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.932
diff -u -r1.932 common.inc
--- includes/common.inc	10 Jul 2009 05:45:56 -0000	1.932
+++ includes/common.inc	12 Jul 2009 17:51:21 -0000
@@ -4042,10 +4042,12 @@
   $children = array();
   $sortable = FALSE;
   foreach ($elements as $key => $value) {
-    if ($key[0] !== '#') {
-      $children[$key] = $value;
-      if (is_array($value) && isset($value['#weight'])) {
-        $sortable = TRUE;
+    if ($key) {
+      if ($key[0] !== '#') {
+        $children[$key] = $value;
+        if (is_array($value) && isset($value['#weight'])) {
+          $sortable = TRUE;
+        }
       }
     }
   }
