diff --git a/core/lib/Drupal/Core/Theme/Registry.php b/core/lib/Drupal/Core/Theme/Registry.php
index 0167a74..01f18d4 100644
--- a/core/lib/Drupal/Core/Theme/Registry.php
+++ b/core/lib/Drupal/Core/Theme/Registry.php
@@ -429,7 +429,8 @@ protected function processExtension(array &$cache, $name, $type, $theme, $path)
     // merge it into $cache.
     $function = $name . '_theme';
     if (function_exists($function)) {
-      $result = $function($cache, $type, $theme, $path);
+      // Cast to an array to not fail an empty hook_theme implementations.
+      $result = (array) $function($cache, $type, $theme, $path);
       foreach ($result as $hook => $info) {
         // When a theme or engine overrides a module's theme function
         // $result[$hook] will only contain key/value pairs for information being
diff --git a/core/modules/system/src/Tests/Theme/RegistryTest.php b/core/modules/system/src/Tests/Theme/RegistryTest.php
index 92d52b4..e432e89 100644
--- a/core/modules/system/src/Tests/Theme/RegistryTest.php
+++ b/core/modules/system/src/Tests/Theme/RegistryTest.php
@@ -63,6 +63,12 @@ function testRaceCondition() {
     $registry = new ThemeRegistry($cid, $cache, $lock_backend, array('theme_registry'), $this->container->get('module_handler')->isLoaded());
     $this->assertTrue($registry->get('theme_test_template_test'), 'Offset was returned correctly from the theme registry');
     $this->assertTrue($registry->get('theme_test_template_test_2'), 'Offset was returned correctly from the theme registry');
+
+    // Set the hook_theme() result to NULL, to ensure that it does not break.
+    $this->container->get('state')->set('theme_test_theme_null', NULL);
+    $registry->clear();
+    $this->assertFalse(isset($registry['theme_test_template_test']));
+    $this->assertFalse(isset($registry['theme_test_template_test']));
   }
 
   /**
diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module
index 8a8841e..1dbbf58 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -6,6 +6,9 @@
  * Implements hook_theme().
  */
 function theme_test_theme($existing, $type, $theme, $path) {
+  if (Drupal::state()->get('theme_test_theme_null')) {
+    return NULL;
+  }
   $items['theme_test'] = array(
     'file' => 'theme_test.inc',
     'variables' => array('foo' => ''),
