diff --git a/core/lib/Drupal/Core/Entity/EntityBundleAccessCheck.php b/core/lib/Drupal/Core/Entity/EntityBundleAccessCheck.php
index e027b91153..3d5d698031 100644
--- a/core/lib/Drupal/Core/Entity/EntityBundleAccessCheck.php
+++ b/core/lib/Drupal/Core/Entity/EntityBundleAccessCheck.php
@@ -18,7 +18,7 @@ class EntityBundleAccessCheck implements AccessInterface {
    *
    * @code
    * example.route:
-   *   path: foo/{entity_type}/{example}
+   *   path: foo/{entity_type}/{other_parameter}
    *   requirements:
    *     _entity_bundle: 'example_entity_type:example_bundle'
    * @endcode
@@ -39,10 +39,8 @@ public function access(Route $route, RouteMatchInterface $route_match, AccountIn
       $parameters = $route_match->getParameters();
       if ($parameters->has($entity_type)) {
         $entity = $parameters->get($entity_type);
-        if ($entity instanceof EntityInterface) {
-          if ($entity->bundle() !== $bundle) {
-            return AccessResult::forbidden();
-          }
+        if ($entity instanceof EntityInterface && $entity->bundle() !== $bundle) {
+          return AccessResult::forbidden();
         }
       }
     }
