From 3ca2c10f481fc950da112ea02846bc9b4d8e1aad Mon Sep 17 00:00:00 2001 From: Alex Tepes Date: Wed, 30 Oct 2024 12:08:43 +0200 Subject: [PATCH] fix: return empty string on null relation --- src/Services/Listings/Columns/Relation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Listings/Columns/Relation.php b/src/Services/Listings/Columns/Relation.php index c4af259d9..6e818c90c 100644 --- a/src/Services/Listings/Columns/Relation.php +++ b/src/Services/Listings/Columns/Relation.php @@ -52,6 +52,6 @@ protected function getRenderValue(TwillModelContract $model): string if (is_a($relation, 'Illuminate\Database\Eloquent\Model')) { $relation = collect([$relation]); } - return $relation->pluck($this->field)->join(', '); + return is_null($relation) ? '' : $relation->pluck($this->field)->join(', '); } }