Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.337.2.7
diff -u -p -r1.337.2.7 theme.inc
--- includes/theme.inc	5 Dec 2008 22:32:50 -0000	1.337.2.7
+++ includes/theme.inc	10 Jan 2009 03:18:45 -0000
@@ -40,6 +40,25 @@ function init_theme() {
   drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
   $themes = list_themes();
 
+  // Use the administrative theme if the user is looking at a page in the
+  // admin/* path.
+  if (arg(0) == 'admin') {
+    if ($_GET['q'] == 'admin/build/block' || strpos($_GET['q'], 'admin/build/block/list') !== FALSE) {
+      // admin/build/block needs to set $custom_theme. If we get to this point,
+      // and $custom_theme hasn't been set, it means init_theme() has been
+      // called before block_admin_display() got to it. Wait to run the rest
+      // of the function until block_admin_display() gets around to
+      // changing $custom_theme. See http://drupal.org/node/100393.
+      if (!isset($custom_theme)) {
+        return;
+      }
+    } else {
+      // We're on some other admin page, and we can safely set $custom_theme.
+      $custom_theme = variable_get('admin_theme', '0');
+    }
+    drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
+  }
+
   // Only select the user selected theme if it is available in the
   // list of enabled themes.
   $theme = !empty($user->theme) && !empty($themes[$user->theme]->status) ? $user->theme : variable_get('theme_default', 'garland');
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.440.2.45
diff -u -p -r1.440.2.45 system.module
--- modules/system/system.module	11 Dec 2008 17:51:34 -0000	1.440.2.45
+++ modules/system/system.module	10 Jan 2009 03:18:47 -0000
@@ -302,15 +302,6 @@ function system_menu($may_cache) {
       'type' => MENU_CALLBACK);
   }
   else {
-    /**
-     * Use the administrative theme if the user is looking at a page in the admin/* path.
-     */
-    if (arg(0) == 'admin') {
-      global $custom_theme;
-      $custom_theme = variable_get('admin_theme', '0');
-      drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
-    }
-
     // Add the CSS for this module. We put this in !$may_cache so it is only
     // added once per request.
     drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module');
