diff --git a/src/Objects/Sources/CSVSource.php b/src/Objects/Sources/CSVSource.php index 3490cd4..83a198c 100755 --- a/src/Objects/Sources/CSVSource.php +++ b/src/Objects/Sources/CSVSource.php @@ -57,7 +57,7 @@ public function getDataRows(int $page = 1, array $fieldsToRetrieve = []): array $dataRow = new DataRow(); foreach ($line as $key => $value) { - if (in_array($this->fields[$key], $fieldsToRetrieve)) { + if (array_key_exists($key, $this->fields) && in_array($this->fields[$key], $fieldsToRetrieve)) { $dataRow->addDataItem(new DataItem($this->fields[$key], $value)); } }