diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index 9269e88..e0cc9c0 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -95,8 +95,12 @@ class AppRuntime implements RuntimeExtensionInterface }; } - public function mapGender(string $gender): string + public function mapGender(?string $gender): string { + if (null === $gender) { + return ''; + } + $gender = strtoupper($gender); return match ($gender) {