From bf523130905b610ef7c6bd951a1abcce51d11332 Mon Sep 17 00:00:00 2001 From: Carlos Junior Date: Wed, 16 Jun 2021 15:28:15 -0300 Subject: [PATCH] Update Csv.php If the CSV field is empty it can cause an SQL error, replacing it with NULL does not cause an error. Note: Database column cannot be "NOT NULL" --- src/Extractors/Csv.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Extractors/Csv.php b/src/Extractors/Csv.php index 1aaf63b7..2a8a0e7a 100644 --- a/src/Extractors/Csv.php +++ b/src/Extractors/Csv.php @@ -68,7 +68,7 @@ protected function makeRow($row, $columns) $data = []; foreach ($columns as $column => $index) { - $data[$column] = $row[$index - 1]; + $data[$column] = $row[$index - 1] != "" ? $row[$index - 1] : NULL ; } return $data;