From a8a7ed4c69d1121a6a1a3b9a6bebd233e999c8bc Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Tue, 4 Aug 2026 23:08:39 +0700 Subject: [PATCH] fix: handle potential null value for gender in genderLabel method --- app/Models/UserProfile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/UserProfile.php b/app/Models/UserProfile.php index 82eed55..de5f13f 100644 --- a/app/Models/UserProfile.php +++ b/app/Models/UserProfile.php @@ -37,7 +37,7 @@ protected function formattedBirthDate(): Attribute protected function genderLabel(): Attribute { return Attribute::make( - get: fn () => $this->gender->label(), + get: fn () => $this->gender?->label(), ); }