Skip to content

Commit

Permalink
Move patch to the correct loop
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Millar <rid@cylo.io>
  • Loading branch information
Rid authored and flavioheleno committed Feb 16, 2023
1 parent d72a49d commit eda01f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions patches/NetworkSettingsNormalizer.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php
index dc48cc5..2e492d2 100644
index dc48cc5..a3cb884 100644
--- a/src/Normalizer/NetworkSettingsNormalizer.php
+++ b/src/Normalizer/NetworkSettingsNormalizer.php
@@ -81,6 +81,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte
@@ -79,6 +79,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte
if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) {
$values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS);
foreach ($data['Ports'] as $key => $value) {
+ if ($value === null) {
+ $values[$key] = null;
+ continue;
+ }
$values_1 = array();
foreach ($value as $value_1) {
+ if ($value === null) {
+ $values[$key] = null;
+ continue;
+ }
$values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context);
}
$values[$key] = $values_1;
@@ -218,6 +222,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte
if ($object->isInitialized('ports') && null !== $object->getPorts()) {
$values = array();
Expand Down
8 changes: 4 additions & 4 deletions src/Normalizer/NetworkSettingsNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ public function denormalize($data, $class, $format = null, array $context = [])
if (\array_key_exists('Ports', $data) && null !== $data['Ports']) {
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($data['Ports'] as $key => $value) {
if (null === $value) {
$values[$key] = null;
continue;
}
$values_1 = [];
foreach ($value as $value_1) {
if (null === $value) {
$values[$key] = null;
continue;
}
$values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context);
}
$values[$key] = $values_1;
Expand Down

0 comments on commit eda01f4

Please sign in to comment.