diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 2d40d78..99ad8c5 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -281,3 +281,20 @@ function block_configurable_language_delete(ConfigurableLanguageInterface $langu
     }
   }
 }
+
+/**
+ * Implements hook_node_type_delete().
+ *
+ * Delete the potential block visibility settings of the deleted node bundles.
+ */
+function block_node_type_delete(NodeTypeInterface $node_type) {
+  foreach (Block::loadMultiple() as $block) {
+    /** @var $block \Drupal\block\BlockInterface */
+    $visibility = $block->getVisibility();
+    if (isset($visibility['node_type']['bundles'][$node_type->id()])) {
+      unset($visibility['node_type']['bundles'][$node_type->id()]);
+      $block->setVisibilityConfig('node_type', $visibility['node_type']);
+      $block->save();
+    }
+  }
+}
diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php
index 17fd982..405401b 100644
--- a/core/modules/block/src/Tests/BlockTest.php
+++ b/core/modules/block/src/Tests/BlockTest.php
@@ -7,8 +7,9 @@
 
 namespace Drupal\block\Tests;
 
-use Drupal\Component\Utility\Html;
 use Drupal\block\Entity\Block;
+use Drupal\Component\Utility\Html;
+use Drupal\node\Entity\NodeType;
 use Drupal\user\Entity\Role;
 use Drupal\user\RoleInterface;
 
@@ -480,4 +481,38 @@ public function testBlockUserRoleDelete() {
     ]);
   }
 
+  /**
+   * Tests block_node_type_delete.
+   */
+  public function testBlockNodeTypeDelete() {
+    $node_type1 = $this->drupalCreateContentType();
+    $node_type2 = $this->drupalCreateContentType();
+
+    $block = Block::create([
+      'id' => $this->randomMachineName(),
+      'plugin' => 'system_powered_by_block',
+    ]);
+
+    $block->setVisibilityConfig('node_type', [
+      'bundles' => [
+        $node_type1->id() => $node_type1->id(),
+        $node_type2->id() => $node_type2->id(),
+      ],
+    ]);
+
+    $block->save();
+
+    $this->assertEqual($block->getVisibility()['node_type']['bundles'], [
+      $node_type1->id() => $node_type1->id(),
+      $node_type2->id() => $node_type2->id()
+    ]);
+
+    $node_type1->delete();
+
+    $block = Block::load($block->id());
+    $this->assertEqual($block->getVisibility()['node_type']['bundles'], [
+      $node_type2->id() => $node_type2->id()
+    ]);
+  }
+
 }
