Skip to content

Commit

Permalink
#9 fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Bukashk0zzz committed Aug 19, 2016
1 parent d8c44b7 commit 84457da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EventListener/JmsPostSerializeListener.php
Expand Up @@ -44,7 +44,7 @@ public function onPostSerialize(ObjectEvent $event)
$liipAnnotation = $this->annotationReader->getPropertyAnnotation($property, LiipImagineSerializableField::class);
$property->setAccessible(true);

if ($liipAnnotation instanceof LiipImagineSerializableField && ($value = $property->getValue($object)) && ($virtualField = $liipAnnotation->getVirtualField())) {
if ($liipAnnotation instanceof LiipImagineSerializableField && ($value = $property->getValue($object)) && !is_array($value) && $virtualField = $liipAnnotation->getVirtualField()) {
if (array_key_exists('vichUploaderSerialize', $this->config) && $this->config['vichUploaderSerialize'] && $liipAnnotation->getVichUploaderField()) {
$valueArray = explode('/', $value);
$value = end($valueArray);
Expand Down
2 changes: 1 addition & 1 deletion EventListener/JmsPreSerializeListener.php
Expand Up @@ -43,7 +43,7 @@ public function onPreSerialize(ObjectEvent $event)
$liipAnnotation = $this->annotationReader->getPropertyAnnotation($property, LiipImagineSerializableField::class);
$property->setAccessible(true);

if ($liipAnnotation instanceof LiipImagineSerializableField && $value = $property->getValue($object)) {
if ($liipAnnotation instanceof LiipImagineSerializableField && ($value = $property->getValue($object)) && !is_array($value)) {
$vichField = $liipAnnotation->getVichUploaderField();

if (!$liipAnnotation->getVirtualField()) {
Expand Down

0 comments on commit 84457da

Please sign in to comment.