changeset 37:7d1e353520ca

just return empty users list, when the score link table is missed.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 16 Oct 2008 21:40:14 +0800
parents 704d76b67670
children 0863b32e1a05
files Ikariam.pm
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Ikariam.pm	Sat Oct 11 05:21:06 2008 +0800
+++ b/Ikariam.pm	Thu Oct 16 21:40:14 2008 +0800
@@ -58,12 +58,13 @@
     my $status = gunzip \$res->content => \$c 
         or die "gunzip failed: $GunzipError\n";
 
+    my %users;
     my $html = HTML::TagParser->new($c);
+    my ($table) = $html->getElementsByAttribute("class", "table01");
+    return %users if(!defined($table));
 
-    my ($table) = $html->getElementsByAttribute("class", "table01");
     my @elems = getElementsByTagName($table, "tr");
 
-    my %users;
     foreach my $elem (@elems) {
         my $e;
         my %user;