aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2016-06-17 16:00:16 +0100
committerMatthew Somerville <matthew@mysociety.org>2016-06-17 16:00:16 +0100
commite23b4976752cfbc2e462c3da65bda8597bb9d4bf (patch)
tree46e4eaf8f5f6aeb4f80f591c5f4c48ed7d1b91a0
parent1e52bd4bb74d4d9ece6bd42bea60886eb618b12a (diff)
Improve Open311 handling of bad attribute data.
We have seen e.g. an endpoint that is returning 'serviceAttributes' as the child of 'attributes', rather than 'attribute'.
-rw-r--r--perllib/Open311/PopulateServiceList.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm
index f5f117fb5..b0ffe3806 100644
--- a/perllib/Open311/PopulateServiceList.pm
+++ b/perllib/Open311/PopulateServiceList.pm
@@ -207,7 +207,7 @@ sub _add_meta_to_contact {
print "Fetching meta data for " . $self->_current_service->{service_code} . "\n" if $self->verbose >= 2;
my $meta_data = $self->_current_open311->get_service_meta_info( $self->_current_service->{service_code} );
- unless ($meta_data->{attributes}) {
+ unless (ref $meta_data->{attributes} eq 'ARRAY') {
warn sprintf( "Empty meta data for %s at %s",
$self->_current_service->{service_code},
$self->_current_body->endpoint )