From: Bjørn Rustad Date: Sat, 17 Aug 2013 14:29:02 +0000 (+0200) Subject: Empty team names from cdb possible X-Git-Url: http://git.rustad.me/?a=commitdiff_plain;h=08d6f005a22318f0a4f640416d4daa3ae3d3d552;p=duplo Empty team names from cdb possible --- diff --git a/lib/Duplo.pm b/lib/Duplo.pm index 9979506..98b1e12 100644 --- a/lib/Duplo.pm +++ b/lib/Duplo.pm @@ -54,7 +54,7 @@ sub startup { $config->{'db_pass'}, { pg_enable_utf8 => 1, - RaiseError => 1 + RaiseError => 0, }); } ); diff --git a/lib/Duplo/Results.pm b/lib/Duplo/Results.pm index 42df6f9..435a896 100644 --- a/lib/Duplo/Results.pm +++ b/lib/Duplo/Results.pm @@ -45,16 +45,21 @@ sub cdb_getlist { $pos += 0; + my $team = ''; + my $team_id; + if ($tr->td->[3]->can('a')) { + $team = decode('UTF-8', $tr->td->[3]->a->text); + + $team_id = $tr->td->[3]->a->{'href'} + =~ /\/team\/[^\/]*\/(\d+)/; + + } my $name = decode('UTF-8', $tr->td->[2]->a->text); - my $team = decode('UTF-8', $tr->td->[3]->a->text); my $time = decode('UTF-8', $tr->td->[4]->text); my ($rider_id) = $tr->td->[2]->a->{'href'} =~ /\/rider\/[^\/]*\/(\d+)/; - my ($team_id) = $tr->td->[3]->a->{'href'} - =~ /\/team\/[^\/]*\/(\d+)/; - push @list, { dnf => $dnf, pos => $pos,