Skip to content

Commit 2223272

Browse files
committed
[Serializer] Fix CsvEncoder decode on empty data
1 parent d59d2e5 commit 2223272

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Serializer/Encoder/CsvEncoder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function decode(string $data, string $format, array $context = []): mixed
154154
$headerCount = array_fill(0, $nbCols, 1);
155155
} else {
156156
foreach ($cols as $col) {
157-
$header = explode($keySeparator, $col);
157+
$header = explode($keySeparator, $col ?? '');
158158
$headers[] = $header;
159159
$headerCount[] = \count($header);
160160
}

0 commit comments

Comments
 (0)