Bläddra i källkod

FD3-755 se corrige insert en tabla hosts de kea

Espinoza Guillermo 6 år sedan
förälder
incheckning
88d4822487
1 ändrade filer med 6 tillägg och 4 borttagningar
  1. 6 4
      src/KeaBundle/Services/KeaConfigService.php

+ 6 - 4
src/KeaBundle/Services/KeaConfigService.php

@@ -246,11 +246,13 @@ class KeaConfigService
             // se usan valores por defecto
             $config = $this->getConfig(1, 'BaseKea', '/kea-cm-hook/kea-hook-flowdat.so');
             $configDecode = json_decode($config, true);
-            foreach ($configDecode[0]['arguments']['Dhcp4']['subnet4'] as $subnetConfig) {
-                if ($subnetConfig['subnet'] == $subnet->getAddress()) {
-                    break;
+            if (isset($configDecode[0]['arguments']['Dhcp4']['subnet4'])) {
+                foreach ($configDecode[0]['arguments']['Dhcp4']['subnet4'] as $subnetConfig) {
+                    if ($subnetConfig['subnet'] == $subnet->getAddress()) {
+                        break;
+                    }
+                    $position++;
                 }
-                $position++;
             }
         }