From 3bef13458a97c7216df3d46b978240b8df9d7e94 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Tue, 21 Feb 2006 08:47:15 +0000
Subject: [PATCH] - Patch #42935 by thierry_gd: fixed problem with upgrading
 the theme.  (Today's critical bugfix #3.)

---
 database/updates.inc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/database/updates.inc b/database/updates.inc
index c7192509ea6b..095176103c7e 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -667,6 +667,13 @@ function system_update_144() {
 
 function system_update_145() {
   $default_theme = variable_get('theme_default', 'bluemarine');
+
+  $themes = list_themes();
+  if (!array_key_exists($default_theme, $themes)) {
+      variable_set('theme_default', 'bluemarine');
+      $default_theme = 'bluemarine';
+   }
+
   $ret = array();
 
   switch ($GLOBALS['db_type']) {
-- 
GitLab