From 8832a12cd8307fea49aa0725930577c7d29d0359 Mon Sep 17 00:00:00 2001 From: AnabolicsAnonymous Date: Mon, 25 Aug 2025 10:24:54 -0500 Subject: [PATCH] fix: check for null values on claimed & filled --- app/Http/Resources/TorrentRequestResource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Resources/TorrentRequestResource.php b/app/Http/Resources/TorrentRequestResource.php index 547531800..ee4fc45f5 100644 --- a/app/Http/Resources/TorrentRequestResource.php +++ b/app/Http/Resources/TorrentRequestResource.php @@ -50,8 +50,8 @@ class TorrentRequestResource extends JsonResource 'bounty' => $this->bounties?->sum('seedbonus') ?? 0, 'status' => $this->filled_by ? ($this->approved_by ? 'filled' : 'pending') : ($this->claim ? 'claimed' : 'unfilled'), 'claimed' => (bool) $this->claim, - 'claimed_by' => $this->when($this->claim, $this->claim?->anon ? 'anonymous' : ($this->claim?->user?->username ?? null)), - 'filled_by' => $this->when($this->filled_by, $this->filled_anon ? 'anonymous' : ($this->filler?->username ?? null)), + 'claimed_by' => $this->when($this->claim !== null, $this->claim?->anon ? 'anonymous' : ($this->claim?->user?->username ?? null)), + 'filled_by' => $this->when($this->filled_by !== null, $this->filled_anon ? 'anonymous' : ($this->filler?->username ?? null)), 'created' => $this->created_at->toIso8601String(), 'updated_at' => $this->updated_at->toIso8601String(), ];