diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
index 30d84223d0b22dfe8abb7e331a52c796b94e5394..ed43e49aa841d29114cc75cc98350ff57f20505d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php
@@ -231,4 +231,14 @@ function testSwitchDefaultTheme() {
     $this->drupalGet('admin/structure/block');
     $this->assertText('Stark(' . t('active tab') . ')', t('Default local task on blocks admin page has changed.'));
   }
+
+  /**
+   * Test that themes can't be enabled when the base theme or engine is missing.
+   */
+  function testInvalidTheme() {
+    module_enable(array('theme_page_test'));
+    $this->drupalGet('admin/appearance');
+    $this->assertText(t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => 'not_real_test_basetheme')), 'Invalid base theme check succeeded.');
+    $this->assertText(t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => 'not_real_engine')), 'Invalid theme engine check succeeded.');
+  }
 }
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 2947245d4ea6e580a4340a1834fe0f5addb891e4..2e424adbee4f6c2dcc5a9aa49a8788208534d99e 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -156,10 +156,14 @@ function system_themes_page() {
      // content has a common place in all themes.
       $theme->incompatible_core = !isset($theme->info['core']) || ($theme->info['core'] != DRUPAL_CORE_COMPATIBILITY) || (!isset($theme->info['regions']['content']));
       $theme->incompatible_php = version_compare(phpversion(), $theme->info['php']) < 0;
+      // Confirmed that the base theme is available.
+      $theme->incompatible_base = (isset($theme->info['base theme']) && !isset($themes[$theme->info['base theme']]));
+      // Confirm that the theme engine is available.
+      $theme->incompatible_engine = (isset($theme->info['engine']) && !isset($theme->owner));
     }
     $query['token'] = drupal_get_token('system-theme-operation-link');
     $theme->operations = array();
-    if (!empty($theme->status) || !$theme->incompatible_core && !$theme->incompatible_php) {
+    if (!empty($theme->status) || !$theme->incompatible_core && !$theme->incompatible_php && !$theme->incompatible_base && !$theme->incompatible_engine) {
       // Create the operations links.
       $query['theme'] = $theme->name;
       if (drupal_theme_access($theme)) {
@@ -2725,6 +2729,12 @@ function theme_system_themes_page($variables) {
         }
         $output .= '<div class="incompatible">' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())) . '</div>';
       }
+      elseif (!empty($theme->incompatible_base)) {
+        $output .= '<div class="incompatible">' . t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => $theme->info['base theme'])) . '</div>';
+      }
+      elseif (!empty($theme->incompatible_engine)) {
+        $output .= '<div class="incompatible">' . t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => $theme->info['engine'])) . '</div>';
+      }
       else {
         $output .= theme('links', array('links' => $theme->operations, 'attributes' => array('class' => array('operations', 'clearfix'))));
       }
diff --git a/core/modules/system/tests/modules/theme_page_test/theme_page_test.info b/core/modules/system/tests/modules/theme_page_test/theme_page_test.info
new file mode 100644
index 0000000000000000000000000000000000000000..78e5bb42d586332aae3f49969525928365533c79
--- /dev/null
+++ b/core/modules/system/tests/modules/theme_page_test/theme_page_test.info
@@ -0,0 +1,6 @@
+name = "Theme page test"
+description = "Support module for theme system testing."
+package = Testing
+version = VERSION
+core = 8.x
+
diff --git a/core/modules/system/tests/modules/theme_page_test/theme_page_test.module b/core/modules/system/tests/modules/theme_page_test/theme_page_test.module
new file mode 100644
index 0000000000000000000000000000000000000000..fe86da9cd8b317fdd4c2c77c002ebea28b233835
--- /dev/null
+++ b/core/modules/system/tests/modules/theme_page_test/theme_page_test.module
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Implements hook_system_info_alter().
+ */
+function theme_page_test_system_info_alter(&$info, $file, $type) {
+  // Make sure that all themes are visible on the Appearance form.
+  if ($type == 'theme') {
+    unset($info['hidden']);
+  }
+}
+
+
+/**
+ * Implements hook_system_theme_info().
+ */
+function theme_page_test_system_theme_info() {
+  $themes['test_invalid_basetheme'] = drupal_get_path('module', 'system') . '/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info';
+  $themes['test_invalid_engine'] = drupal_get_path('module', 'system') . '/tests/themes/test_invalid_engine/test_invalid_engine.info';
+  return $themes;
+}
\ No newline at end of file
diff --git a/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info b/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info
new file mode 100644
index 0000000000000000000000000000000000000000..915a5c7c38b79cb1c46e049b62da1ab7ab02f1ff
--- /dev/null
+++ b/core/modules/system/tests/themes/test_invalid_basetheme/test_invalid_basetheme.info
@@ -0,0 +1,5 @@
+name = Theme test with invalid base theme
+description = Test theme which has a non-existent base theme.
+core = 8.x
+base theme = not_real_test_basetheme
+hidden = TRUE
diff --git a/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info b/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info
new file mode 100644
index 0000000000000000000000000000000000000000..335600d70052a915f11746febc010b192aed4605
--- /dev/null
+++ b/core/modules/system/tests/themes/test_invalid_engine/test_invalid_engine.info
@@ -0,0 +1,5 @@
+name = Theme test with invalid theme engine
+description = Test theme which has a non-existent theme engine.
+core = 8.x
+hidden = TRUE
+engine = not_real_engine
\ No newline at end of file