diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php index 6d82a9e6..55b517b2 100644 --- a/src/Normalizer/NetworkSettingsNormalizer.php +++ b/src/Normalizer/NetworkSettingsNormalizer.php @@ -57,8 +57,12 @@ public function denormalize($data, $class, $format = null, array $context = []) $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); foreach ($data->{'Ports'} as $key => $value) { $values_1 = []; - foreach ($value as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context); + if (is_iterable($value)){ + foreach ($value as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context); + } + } else { + $values_1[] = $this->denormalizer->denormalize(null, 'Docker\\API\\Model\\PortBinding', 'json', $context); } $values[$key] = $values_1; }