diff --git a/src/Controller/OgRepository/Webhook/ResponseController.php b/src/Controller/OgRepository/Webhook/ResponseController.php index ed8999b..4138890 100644 --- a/src/Controller/OgRepository/Webhook/ResponseController.php +++ b/src/Controller/OgRepository/Webhook/ResponseController.php @@ -86,17 +86,28 @@ class ResponseController extends AbstractOgRepositoryController { $trace = $this->entityManager->getRepository(Trace::class)->findOneBy(['jobId' => $data['job_id']]); $imageUuid = $trace->getInput()['imageUuid']; - $imageImageRepository = $trace->getInput()['imageImageRepositoryUuid']; + $imageImageRepositoryUuid = $trace->getInput()['imageImageRepositoryUuid']; $repositoryUuid = $trace->getInput()['repositoryUuid']; $image = $this->entityManager->getRepository(Image::class)->findOneBy(['uuid' => $imageUuid]); $repository = $this->entityManager->getRepository(ImageRepository::class)->findOneBy(['uuid' => $repositoryUuid]); + $imageImageRepository = $this->entityManager->getRepository(ImageImageRepository::class)->findOneBy(['uuid' => $imageImageRepositoryUuid]); if ($image === null) { $this->updateTraceStatus($trace, TraceStatus::FAILED, 'Image not found'); return; } + if ($repository === null) { + $this->updateTraceStatus($trace, TraceStatus::FAILED, 'Repository not found'); + return; + } + + if ($imageImageRepository === null) { + $this->updateTraceStatus($trace, TraceStatus::FAILED, 'Image repository not found'); + return; + } + $this->logger->info("Image $actionType successful", ['image' => $image->getName()]); // Creamos un objeto imagen nuevo, en el repositorio destino