diff --git a/core/modules/block/src/BlockViewBuilder.php b/core/modules/block/src/BlockViewBuilder.php
index a7cb441..a02b9d9 100644
--- a/core/modules/block/src/BlockViewBuilder.php
+++ b/core/modules/block/src/BlockViewBuilder.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block;
 
+use Drupal\Component\Plugin\Exception\ContextException;
 use Drupal\Core\Block\MainContentBlockPluginInterface;
 use Drupal\Core\Block\TitleBlockPluginInterface;
 use Drupal\Core\Cache\Cache;
@@ -145,7 +146,12 @@ protected static function buildPreRenderableBlock($entity, ModuleHandlerInterfac
     // Inject runtime contexts.
     if ($plugin instanceof ContextAwarePluginInterface) {
       $contexts = \Drupal::service('context.repository')->getRuntimeContexts($plugin->getContextMapping());
-      \Drupal::service('context.handler')->applyContextMapping($plugin, $contexts);
+      try {
+        \Drupal::service('context.handler')->applyContextMapping($plugin, $contexts);
+      }
+      catch (ContextException $e) {
+        return [];
+      }
     }
 
     // Create the render array for the block as a whole.
