diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index 25b837b581..8fd3611033 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -351,7 +351,7 @@ public function setEntity(EntityInterface $entity) {
    * {@inheritdoc}
    */
   public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entity_type_id) {
-    if ($route_match->getRawParameter($entity_type_id) !== NULL) {
+    if ($route_match->getParameter($entity_type_id) !== NULL) {
       $entity = $route_match->getParameter($entity_type_id);
     }
     else {
