aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-10-21 12:54:18 +0100
committerStruan Donald <struan@exo.org.uk>2011-10-21 12:54:18 +0100
commit9ade8e294b263c83f49d25e98d132686d35c2896 (patch)
treef381b7a3dbd64a293cfc8d9287aba8bb68fa5d56 /perllib
parent1dac169f7e758f842f344d5e324e8872b1aff092 (diff)
Do not process council if not endpoint or no services
Diffstat (limited to 'perllib')
-rw-r--r--perllib/Open311/PopulateServiceList.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm
index e89183092..68a9a1750 100644
--- a/perllib/Open311/PopulateServiceList.pm
+++ b/perllib/Open311/PopulateServiceList.pm
@@ -19,6 +19,7 @@ sub process_councils {
my $self = shift;
while ( my $council = $self->council_list->next ) {
+ next unless $council->endpoint;
$self->_current_council( $council );
$self->process_council;
}
@@ -37,6 +38,10 @@ sub process_council {
$self->_check_endpoints;
my $list = $open311->get_service_list;
+ unless ( $list ) {
+ warn "ERROR: no service list found for " . $self->_current_council->area_id . "\n";
+ return;
+ }
$self->process_services( $list );
}