diff --git a/bootstrap/helpers/parsers.php b/bootstrap/helpers/parsers.php index 0ff580366..7ed6d8c7a 100644 --- a/bootstrap/helpers/parsers.php +++ b/bootstrap/helpers/parsers.php @@ -32,10 +32,9 @@ function validateDockerComposeForInjection(string $composeYaml): void throw new \Exception('Invalid YAML format: '.$e->getMessage()); } - if (! isset($parsed['services']) || ! is_array($parsed['services'])) { + if (! is_array($parsed) || ! isset($parsed['services']) || ! is_array($parsed['services'])) { throw new \Exception('Docker Compose file must contain a "services" section'); } - // Validate service names foreach ($parsed['services'] as $serviceName => $serviceConfig) { try {