comparison parsedata.pl @ 192:9f7eb4db99b4 default

Add sanity check for class ID data.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 15 Feb 2016 06:42:51 +0200
parents 9c3100ab29cc
children
comparison
equal deleted inserted replaced
191:f2adb44ea251 192:9f7eb4db99b4
294 if ($tid) 294 if ($tid)
295 { 295 {
296 $maxDays = $cday + 1 if ($cday + 1 > $maxDays); 296 $maxDays = $cday + 1 if ($cday + 1 > $maxDays);
297 297
298 # Grouped, if there is another class ID in second slot 298 # Grouped, if there is another class ID in second slot
299 $cgrouped = 1 if ($$cdata[1] =~ /^([A-Z]\d{5,6}[A-Z]*|[A-Z0-9]{6,8})$/); 299 $cgrouped = 1 if (defined($$cdata[1]) && $$cdata[1] =~ /^([A-Z]\d{5,6}[A-Z]*|[A-Z0-9]{6,8})$/);
300 if ($cgrouped) 300 if ($cgrouped)
301 { 301 {
302 my $cdata1 = []; 302 my $cdata1 = [];
303 my $cdata2 = []; 303 my $cdata2 = [];
304 for (my $i = 0; $i < length($cdata); $i += 2) 304 for (my $i = 0; $i < length($cdata); $i += 2)