diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php index 6b9472fd..ee07f09f 100644 --- a/src/Controller/PartController.php +++ b/src/Controller/PartController.php @@ -234,7 +234,7 @@ final class PartController extends AbstractController } elseif ($assembly instanceof Assembly) { //Initialize a new part for a build part from the given assembly //Ensure that the assembly has not already a build part - if ($project->getBuildPart() instanceof Part) { + if ($assembly->getBuildPart() instanceof Part) { $this->addFlash('error', 'part.new_build_part.error.build_part_already_exists'); return $this->redirectToRoute('part_edit', ['id' => $project->getBuildPart()->getID()]); }