From 6ac073dbcbdcdc3b5162617653530a32992574af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 14 Dec 2015 12:08:30 +0100 Subject: [PATCH] Csv-Helper: Fehlermeldung, wenn Header nicht erkannt wird (Multiplex-Dateien). --- SL/Helper/Csv.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SL/Helper/Csv.pm b/SL/Helper/Csv.pm index 43aaabb91..08ed9f44e 100644 --- a/SL/Helper/Csv.pm +++ b/SL/Helper/Csv.pm @@ -245,6 +245,14 @@ sub _parse_data { my $row = $self->_csv->getline($self->_io); if ($row) { my $header = $self->_header_by_row($row); + if (!$header) { + push @errors, [ + 0, + "Cannot get header for row. Maybe row name and datatype field not matching.", + 0, + 0]; + last; + } my %hr; @hr{@{ $header }} = @$row; push @data, \%hr; -- 2.20.1