From 9ed61ff32b0120a933970a0c5bfaf1de1aa7d9b4 Mon Sep 17 00:00:00 2001 From: Daniel Lienert Date: Thu, 5 Mar 2020 21:21:26 +0100 Subject: [PATCH] BUGFIX: Do not fail when null is given --- Classes/Eel/ArchivistHelper.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/Eel/ArchivistHelper.php b/Classes/Eel/ArchivistHelper.php index 95ccb1f..25e26ab 100644 --- a/Classes/Eel/ArchivistHelper.php +++ b/Classes/Eel/ArchivistHelper.php @@ -25,6 +25,10 @@ class ArchivistHelper implements ProtectedContextAwareInterface */ public function buildSortingCharacter(?string $string, int $position = 0, int $length = 1): string { + if ($string === null) { + return '#'; + } + $character = mb_substr($string, $position, $length); // Transliterate (transform 北京 to 'Bei Jing')