Skip to content
Snippets Groups Projects
Commit 455741bd authored by sarwan verma's avatar sarwan verma Committed by Sascha Grossenbacher
Browse files

Issue #3444598 by sarwan_verma, ritviktak: " TypeError:...

Issue #3444598 by sarwan_verma, ritviktak: " TypeError: Drupal\replicate\Replicator::replicateEntity(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given. "
parent de11117c
No related branches found
No related tags found
1 merge request!110fixed null given issue
Pipeline #245665 passed with warnings
......@@ -38,7 +38,9 @@ class ReplicateFieldSubscriber implements EventSubscriberInterface {
$field_item_list = $event->getFieldItemList();
if ($field_item_list->getItemDefinition()->getSetting('target_type') == 'paragraph') {
foreach ($field_item_list as $field_item) {
$field_item->entity = $this->replicator->replicateEntity($field_item->entity);
if ($field_item->entity) {
$field_item->entity = $this->replicator->replicateEntity($field_item->entity);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment