diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index d857f65..fd5a8d9 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -562,7 +562,7 @@ function drupal_get_filename($type, $name, $filename = NULL) {
  */
 function variable_init($conf = array(), $regenerate = FALSE, $recursion_depth = 0) {
   // NOTE: caching the variables improves performance by 20% when serving cached pages.
-  if (!$regenerate && $cached = cache_get('variables', 'cache')) {
+  if (!$regenerate && $cached = cache_get('variables', 'cache') && !empty($cached->data)) {
     $variables = $cached->data;
   }
   else {
@@ -571,7 +571,10 @@ function variable_init($conf = array(), $regenerate = FALSE, $recursion_depth =
       while ($variable = db_fetch_object($result)) {
         $variables[$variable->name] = unserialize($variable->value);
       }
-      cache_set('variables', $variables);
+      if (!empty($variables)) {
+        cache_set('variables', $variables);
+      }
+      // Else this shouldn't happen, but it did, so what should we do now? Fail with HTTP 500?
       if (!defined('MAINTENANCE_MODE')) {
         lock_release('variable_cache_regenerate');
       }
