diff options
author | Marius Halden <marius.h@lden.org> | 2015-02-14 07:59:25 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2015-02-14 07:59:25 +0100 |
commit | 482384808d02037edec92d5a454277340e99df89 (patch) | |
tree | 56bd8b43e1343915a951f964f54b9e92e9eb7dc8 | |
parent | 3364a2bf1c24016221e17173152b6876a19c32c3 (diff) | |
download | appdrift-stats-482384808d02037edec92d5a454277340e99df89.tar.gz appdrift-stats-482384808d02037edec92d5a454277340e99df89.tar.bz2 appdrift-stats-482384808d02037edec92d5a454277340e99df89.tar.xz |
Check for empty scoreboard after splitting it up
-rwxr-xr-x | stats.pl | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -37,7 +37,7 @@ my @group_names = (); my $content = get($score_url); if (!defined($content) || !$content || length $content < 1) { print STDERR "Could not fetch scoreboard!"; - exit 1 + exit 1; } my $now = `date +%Y%m%d-%H%M%S`; @@ -48,6 +48,11 @@ close FH; my @content = split /^-+$/m, $content; shift @content; +if (scalar @content < 1) { + print STDERR, "Scoreboard seems to be empty!"; + exit 1; +} + for my $section (@content) { my ($position, $user, $balance, $endpoint, $time_up, $time_maint, $time_down) = (undef); |