From f83054db7e74bfefefbb4e114530ec3785ea90a0 Mon Sep 17 00:00:00 2001 From: Lupu Gheorghe <46172059+gheorghelupu17@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:49:39 +0300 Subject: [PATCH] fix (#387) --- app/Forms/Components/Link.php | 2 +- app/Models/Activity.php | 2 +- app/Services/OrganizationBadge.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Forms/Components/Link.php b/app/Forms/Components/Link.php index f9415b24..bee91bcb 100644 --- a/app/Forms/Components/Link.php +++ b/app/Forms/Components/Link.php @@ -29,7 +29,7 @@ public function getUsers(): Collection public function getOrganization(): Collection { - return collect([])->push(['name' => $this->getRecord()->organization->name, 'url' => OrganizationResource::getUrl('view', $this->getRecord()->organization)]); + return collect([])->push(['name' => $this->getRecord()->organization?->name, 'url' => OrganizationResource::getUrl('view', $this->getRecord()->organization)]); } public function getProject(): Collection diff --git a/app/Models/Activity.php b/app/Models/Activity.php index 3bb95f52..a63066da 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -184,6 +184,6 @@ public function getModifiedField(mixed $value): ?string $value = $value ? __('field.boolean.true') : __('field.boolean.false'); } - return $value; + return (string) $value; } } diff --git a/app/Services/OrganizationBadge.php b/app/Services/OrganizationBadge.php index 0c7e06d1..6b4afbd1 100644 --- a/app/Services/OrganizationBadge.php +++ b/app/Services/OrganizationBadge.php @@ -30,7 +30,7 @@ public function updateOrganizationBadge(Organization $organization): void ->with('badges') ->first(); - if (! $badgeCategory->badges) { + if (! $badgeCategory?->badges) { return; }