aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2015-02-14 07:59:25 +0100
committerMarius Halden <marius.h@lden.org>2015-02-14 07:59:25 +0100
commit482384808d02037edec92d5a454277340e99df89 (patch)
tree56bd8b43e1343915a951f964f54b9e92e9eb7dc8
parent3364a2bf1c24016221e17173152b6876a19c32c3 (diff)
downloadappdrift-stats-482384808d02037edec92d5a454277340e99df89.tar.gz
appdrift-stats-482384808d02037edec92d5a454277340e99df89.tar.bz2
appdrift-stats-482384808d02037edec92d5a454277340e99df89.tar.xz
Check for empty scoreboard after splitting it up
-rwxr-xr-xstats.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/stats.pl b/stats.pl
index 9643de9..4614b3f 100755
--- a/stats.pl
+++ b/stats.pl
@@ -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);