Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.398
diff -u -p -r1.398 theme.inc
--- includes/theme.inc	30 Nov 2007 12:19:10 -0000	1.398
+++ includes/theme.inc	30 Nov 2007 16:00:24 -0000
@@ -416,7 +416,7 @@ function list_themes($refresh = FALSE) {
     $list = array();
     $themes = array();
     // Extract from the database only when it is available.
-    if (db_is_active()) {
+    if (db_is_active() && db_table_exists('system')) {
       $result = db_query("SELECT * FROM {system} WHERE type = '%s'", 'theme');
       while ($theme = db_fetch_object($result)) {
         if (file_exists($theme->filename)) {
