Skip to content

Commit

Permalink
fix: return empty string on null relation
Browse files Browse the repository at this point in the history
  • Loading branch information
alextepes committed Oct 30, 2024
1 parent d448fee commit 3ca2c10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Services/Listings/Columns/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ');
}
}

0 comments on commit 3ca2c10

Please sign in to comment.