Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.399
diff -u -p -r1.399 theme.inc
--- includes/theme.inc	30 Nov 2007 16:10:28 -0000	1.399
+++ includes/theme.inc	30 Nov 2007 16:23:30 -0000
@@ -416,6 +416,8 @@ function list_themes($refresh = FALSE) {
     $list = array();
     $themes = array();
     // Extract from the database only when it is available.
+    // Also check if system table exists to allow flawless installation via
+    // install.php if settings are configured but database is empty.
     if (db_is_active() && db_table_exists('system')) {
       $result = db_query("SELECT * FROM {system} WHERE type = '%s'", 'theme');
       while ($theme = db_fetch_object($result)) {
