Block not active snip version editing
This commit is contained in:
@ -35,6 +35,9 @@ class SnipTwigExtension extends AbstractExtension
|
||||
function snipLink(int $id): string
|
||||
{
|
||||
$snip = $this->snipRepo->find($id);
|
||||
if ($snip === null) {
|
||||
throw new \Exception(sprintf('Snip not found with id: %d', $id));
|
||||
}
|
||||
return sprintf('<a class="btn btn-sm btn-primary" href="%s">%s</a>', $this->snipPath($id), $snip);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user