diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 3a236e4..a2c43cd 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -463,7 +463,7 @@ function _theme_process_registry(&$cache, $name, $type, $theme, $path) {
   // merge it into $cache.
   $function = $name . '_theme';
   if (function_exists($function)) {
-    $result = $function($cache, $type, $theme, $path);
+    $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/lib/Drupal/system/Tests/Theme/RegistryTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/RegistryTest.php
index 5ab43ca..c789134 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/RegistryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/RegistryTest.php
@@ -63,5 +63,11 @@ function testRaceCondition() {
     $registry = new ThemeRegistry($cid, 'cache', array('theme_registry' => TRUE));
     $this->assertTrue($registry['theme_test_template_test'], 'Offset was returned correctly from the theme registry');
     $this->assertTrue($registry['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 40a78f3..b900558 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -4,6 +4,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' => ''),
