diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index bc6af1f..a13c0c3 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -550,7 +550,7 @@ function drupal_get_filename($type, $name, $filename = NULL) {
  */
 function variable_init($conf = array()) {
   // NOTE: caching the variables improves performance by 20% when serving cached pages.
-  if ($cached = cache_get('variables', 'cache')) {
+  if ($cached = cache_get('variables', 'cache') && !empty($cached->data)) {
     $variables = $cached->data;
   }
   else {
@@ -558,7 +558,10 @@ function variable_init($conf = array()) {
     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?
   }
 
   foreach ($conf as $name => $value) {
