fix call on null

This commit is contained in:
Kevin Papst
2023-02-06 15:57:30 +01:00
parent 539a7e280c
commit 57722f25fd

View File

@@ -104,6 +104,10 @@ class ActivityService
public function findActivityByName(string $name, ?Project $project = null): ?Activity
{
if ($project === null) {
return $this->repository->findOneBy(['project' => null, 'name' => $name]);
}
return $this->repository->findOneBy(['project' => $project->getId(), 'name' => $name]);
}
}