Skip to content

Commit 9d878d7

Browse files
authored
Merge pull request #18 from sitegeist/bugfix/tolerateEmptyArraysInImageSoucreProxyArrayPresenter
BUGFIX: Tolerate empty arrays in ImageSourceProxyCollectionArrayPresenter
2 parents a800ed8 + e6df199 commit 9d878d7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Classes/TypeConverter/ImageSourceProxyArrayPresenter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public function convertFrom($source, $targetType, array $convertedChildPropertie
6464
if ($source instanceof ImageSourceProxy) {
6565
return $source->jsonSerialize();
6666
}
67+
if ($source === []) {
68+
return [];
69+
}
6770

6871
throw new \Exception(sprintf(
6972
'ImageSourceProxyArrayPresenter can only convert ImageSourceProxy "%s" was given.',

Classes/TypeConverter/ImageSourceProxyCollectionArrayPresenter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ public function convertFrom($source, $targetType, array $convertedChildPropertie
6464
if ($source instanceof ImageSourceProxyCollection) {
6565
return $source->jsonSerialize();
6666
}
67+
if ($source === []) {
68+
return [];
69+
}
6770

6871
throw new \Exception(sprintf(
6972
'ImageSourceProxyArrayPresenter can only convert ImageSourceProxyCollection "%s" was given.',

0 commit comments

Comments
 (0)