From 37c4d11137e3d8970d76744f22a5c03cd9d4198f Mon Sep 17 00:00:00 2001 From: nanaya Date: Thu, 23 Jan 2025 22:24:11 +0900 Subject: [PATCH] Fix setting null profile extras order --- app/Models/UserProfileCustomization.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Models/UserProfileCustomization.php b/app/Models/UserProfileCustomization.php index dcfed82b31b..a1ac56666c1 100644 --- a/app/Models/UserProfileCustomization.php +++ b/app/Models/UserProfileCustomization.php @@ -85,7 +85,7 @@ public static function forUser(?User $user): array|static return $ret; } - public static function repairExtrasOrder($value) + public static function repairExtrasOrder(array $value): array { // read from inside out return array_values( @@ -316,7 +316,10 @@ public function getExtrasOrderAttribute($value) public function setExtrasOrderAttribute($value) { $this->attributes['extras_order'] = null; - $this->setOption('extras_order', static::repairExtrasOrder($value)); + $this->setOption( + 'extras_order', + $value === null ? null : static::repairExtrasOrder($value), + ); } public function getProfileCoverExpandedAttribute()