diff --git a/entityreference.feeds.inc b/entityreference.feeds.inc index 3f64141..3da1479 100644 --- a/entityreference.feeds.inc +++ b/entityreference.feeds.inc @@ -125,10 +125,15 @@ function entityreference_feeds_set_target($source, $entity, $target, $value) { break; case 'label': $options = $handler->getReferencableEntities($value, '='); - $options = reset($options); - $etids = array_keys($options); - // Use the first matching entity. - $entity_id = reset($etids); + if ($options) { + $options = reset($options); + $etids = array_keys($options); + // Use the first matching entity. + $entity_id = reset($etids); + } + else { + $entity_id = NULL; + } break; } /*