Skip to content

Commit

Permalink
Correctly handle empty target value (e.g. for temporary records)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jun 18, 2024
1 parent 8998afa commit 77710b2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/EventListener/DataContainer/ShortlinkLabelListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ public function __invoke(array $row, string $label, DataContainer $dc, array $co
break;

case 'target':
$targetUrl = $this->generator->generateTargetUrl($row['target']);
$columns[$k] = sprintf(
'<a href="%s" target="_blank">%s</a>',
$targetUrl,
$row['name'] ?: $targetUrl,
);
if ($row['target']) {
$targetUrl = $this->generator->generateTargetUrl($row['target']);
$columns[$k] = sprintf(
'<a href="%s" target="_blank">%s</a>',
$targetUrl,
$row['name'] ?: $targetUrl,
);
}
break;

case 'log':
Expand Down

0 comments on commit 77710b2

Please sign in to comment.