diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index d3afdfd..5b82edc 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -156,8 +156,12 @@ class AppRuntime implements RuntimeExtensionInterface return sprintf('%s', $class, $label); } - public function nl2List(string $content, string $class = 'list-disc pl-4'): string + public function nl2List(?string $content, string $class = 'list-disc pl-4'): string { + if (null === $content) { + return ''; + } + $items = explode(PHP_EOL, $content); $list = '