changeset 363:3917a1515e31

fetch_weather: Fix parsing of "empty" CSV data.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 12 Dec 2015 12:25:30 +0200
parents e5a9aaf250b3
children 3b67c66fe0dc
files fetch_weather.pl
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/fetch_weather.pl	Sat Dec 12 11:38:42 2015 +0200
+++ b/fetch_weather.pl	Sat Dec 12 12:25:30 2015 +0200
@@ -359,7 +359,10 @@
         if (defined($line) && $csv->parse($line))
         {
           my @fields = $csv->fields();
-          $$meta_data{$fields[1]} = \@fields;
+          if (scalar(@fields) > 1)
+          {
+            $$meta_data{$fields[1]} = \@fields;
+          }
         }
       }