Browse code

bug #3259 allow null string in StringExtension (garak)

This PR was merged into the 3.x branch.

Discussion
----------

allow null string in StringExtension

Fix #3250

Commits
-------

cf63844c allow null string in StringExtension

Fabien Potencier authored on 11/02/2020 15:23:56
Showing 1 changed files
... ...
@@ -24,8 +24,8 @@ final class StringExtension extends AbstractExtension
24 24
         ];
25 25
     }
26 26
 
27
-    public function createUnicodeString(string $text): UnicodeString
27
+    public function createUnicodeString(?string $text): UnicodeString
28 28
     {
29
-        return new UnicodeString($text);
29
+        return new UnicodeString($text ?? '');
30 30
     }
31 31
 }