From: Tim Pope Date: Mon, 12 Dec 2005 03:33:14 +0000 (+0000) Subject: Allow for no "cumulative" line X-Git-Url: http://git.tpope.net/?p=tpope-extra.git;a=commitdiff_plain;h=077b9ca591ea5e907d975f38449e3fefeb61e815;ds=sidebyside Allow for no "cumulative" line --- diff --git a/perl/schedproc b/perl/schedproc index 81f4a1a..2a80bc3 100755 --- a/perl/schedproc +++ b/perl/schedproc @@ -586,13 +586,15 @@ sub do_html_grades { print "\n"; } } - my $lastrow = $grades->{'cumulative'}->[scalar @{$grades->{'cumulative'}}-1]; - print 'Cumulative: through ', capitalize($lastrow->{'term'}); - print ''; - print $lastrow->{'gpa'}; - print ''; - print join('', ($lastrow->{'earned'}, $lastrow->{'hours'}, $lastrow->{'points'})); - print "\n"; + if(exists($grades->{'cumulative'})) { + my $lastrow = $grades->{'cumulative'}->[scalar @{$grades->{'cumulative'}}-1]; + print 'Cumulative: through ', capitalize($lastrow->{'term'}); + print ''; + print $lastrow->{'gpa'}; + print ''; + print join('', ($lastrow->{'earned'}, $lastrow->{'hours'}, $lastrow->{'points'})); + print "\n"; + } print "\n"; select STDOUT; }