diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index dcb9aae..e601f3e 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -73,10 +73,9 @@ public function getBaseFormID() {
    */
   public function getFormId() {
     $entity_type = $this->entity->getEntityTypeId();
-    $bundle = $this->entity->bundle();
     $form_id = $entity_type;
-    if ($bundle != $entity_type) {
-      $form_id = $bundle . '_' . $form_id;
+    if ($this->entity->getEntityType()->hasKey('bundle')) {
+      $form_id = $this->entity->bundle() . '_' . $form_id;
     }
     if ($this->operation != 'default') {
       $form_id = $form_id . '_' . $this->operation;
