aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/PopulateServiceList.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Open311/PopulateServiceList.pm')
-rw-r--r--perllib/Open311/PopulateServiceList.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm
index 57ef90ecb..7990abfbf 100644
--- a/perllib/Open311/PopulateServiceList.pm
+++ b/perllib/Open311/PopulateServiceList.pm
@@ -72,7 +72,10 @@ sub process_services {
my $list = shift;
$self->found_contacts( [] );
- foreach my $service ( @{ $list->{service} } ) {
+ my $services = $list->{service};
+ # XML might only have one result and then squashed the 'array'-ness
+ $services = [ $services ] unless ref $services eq 'ARRAY';
+ foreach my $service ( @$services ) {
$self->_current_service( $service );
$self->process_service;
}