Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1048
diff -u -p -r1.1048 common.inc
--- includes/common.inc	16 Nov 2009 05:15:21 -0000	1.1048
+++ includes/common.inc	16 Nov 2009 19:31:42 -0000
@@ -3958,6 +3958,10 @@ function drupal_get_js($scope = 'header'
  * @see drupal_render().
  */
 function drupal_process_attached($elements, $weight = JS_DEFAULT, $dependency_check = FALSE) {
+  // Early return if nothing to attach.
+  if (empty($elements['#attached'])) {
+    return TRUE;
+  }
   // Add defaults to the special attached structures that should be processed differently.
   $elements['#attached'] += array(
     'library' => array(),
