mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add catch for null client on project
This commit is contained in:
parent
58fabe2704
commit
bc7fa1d7ad
@ -49,6 +49,12 @@ class ProjectTransformer extends EntityTransformer
|
|||||||
|
|
||||||
public function includeClient(Project $project): \League\Fractal\Resource\Item
|
public function includeClient(Project $project): \League\Fractal\Resource\Item
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!$project->client) {
|
||||||
|
nlog("Project {$project->hashed_id} does not have a client attached - this project is in a bad state");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$transformer = new ClientTransformer($this->serializer);
|
$transformer = new ClientTransformer($this->serializer);
|
||||||
|
|
||||||
return $this->includeItem($project->client, $transformer, Client::class);
|
return $this->includeItem($project->client, $transformer, Client::class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user