diff --git a/core/includes/cache.inc b/core/includes/cache.inc
index d3c3414..91ca6b4 100644
--- a/core/includes/cache.inc
+++ b/core/includes/cache.inc
@@ -36,7 +36,17 @@ function cache($bin = 'cache') {
     if (!isset($class)) {
       $class = variable_get('cache_default_class', 'Drupal\Core\Cache\DatabaseBackend');
     }
-    $cache_objects[$bin] = new $class($bin);
+
+    try {
+      $cache_objects[$bin] = new $class($bin);
+    }
+    catch (Exception $e) {
+      // If creating the cache object failed, for instance if the database
+      // table did not exist, then log the error and fall back to use the
+      // empty cache.
+      $cache_objects[$bin] = new Drupal\Core\Cache\NullBackend($bin);
+      watchdog_exception('cache', $e);
+    }
   }
   return $cache_objects[$bin];
 }
diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
index 44a4111..e541c24 100644
--- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php
+++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php
@@ -31,6 +31,12 @@ class DatabaseBackend implements CacheBackendInterface {
     if ($bin != 'cache') {
       $bin = 'cache_' . $bin;
     }
+
+    // If the cache table does not exist, return a null cache backend instead.
+    if (!db_table_exists($bin)) {
+      throw new \Exception('Invalid database cache bin: ' . $bin);
+    }
+
     $this->bin = $bin;
   }
 
diff --git a/core/modules/simpletest/tests/cache.test b/core/modules/simpletest/tests/cache.test
index 7040aef..c2bd061 100644
--- a/core/modules/simpletest/tests/cache.test
+++ b/core/modules/simpletest/tests/cache.test
@@ -4,6 +4,7 @@ class CacheTestCase extends DrupalWebTestCase {
   protected $default_bin = 'page';
   protected $default_cid = 'test_temporary';
   protected $default_value = 'CacheTest';
+  protected $profile = 'testing';
 
   /**
    * Check whether or not a cache entry exists.
@@ -370,6 +371,21 @@ class CacheClearCase extends CacheTestCase {
     $cached = cache('page')->get($data);
     $this->assertFalse($cached, 'Cached item was invalidated');
   }
+
+  /**
+   * Test invalid bin tables.
+   */
+  function testInvalidCacheBin() {
+    // Assert that the NULl backend is used with an invalid cache bin.
+    $cache = cache('invalid_table');
+    $this->assertEqual(get_class($cache), 'Drupal\Core\Cache\NullBackend');
+
+    // Check that setting, retrieving, and flushing cache data executes without
+    // error, and that the retrieved data will always be empty.
+    $cache->set('test', TRUE);
+    $this->assertFalse($cache->get('test'), 'Cached item from invalid bin returned FALSE.');
+    $cache->flush();
+  }
 }
 
 /**
