diff --git a/src/Form/IndexAddFieldsForm.php b/src/Form/IndexAddFieldsForm.php
index 6341587..c106a6c 100644
--- a/src/Form/IndexAddFieldsForm.php
+++ b/src/Form/IndexAddFieldsForm.php
@@ -357,6 +357,7 @@ class IndexAddFieldsForm extends EntityForm {
 
       $label = $property->getLabel();
       $property = Utility::getInnerProperty($property);
+      $inner_property = $property;
 
       $can_be_indexed = TRUE;
       $nested_properties = array();
@@ -380,15 +381,14 @@ class IndexAddFieldsForm extends EntityForm {
           'field_item:image',
           'field_item:file',
         );
-        if ($property instanceof FieldItemDataDefinition && in_array($property->getDataType(), $allowed_properties)) {
+        if ($inner_property instanceof FieldItemDataDefinition && in_array($inner_property->getDataType(), $allowed_properties)) {
           $entity_type = $this->getEntityTypeManager()
-            ->getDefinition($property->getSetting('target_type'));
+            ->getDefinition($inner_property->getSetting('target_type'));
           if (!$entity_type->isSubclassOf('Drupal\Core\Entity\ContentEntityInterface')) {
             unset($nested_properties['entity']);
           }
         }
       }
-
       // Don't allow indexing of properties with unmapped types. Also, prefer
       // a "parent.child" type mapping (taking into account the parent property
       // for, e.g., text fields).
