Skip to content
Snippets Groups Projects
Commit 4ee9759f authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

don't fail if element is missing

parent 39e7fc19
No related branches found
No related tags found
No related merge requests found
......@@ -138,12 +138,18 @@ sub parse {
my %names =
map { $_->getAttribute('xml:lang') => $_->textContent() }
@names;
$data->{name} = $names{en} ? $names{en} : $names[0]->textContent();
$data->{name} =
$names{en} ? $names{en} :
@names ? $names[0]->textContent() :
undef;
my @urls = $uiinfo->getChildrenByLocalName('InformationURL');
my %urls =
map { $_->getAttribute('xml:lang') => $_->textContent() }
@urls;
$data->{url} = $urls{en} ? $urls{en} : $urls[0]->textContent();
$data->{url} =
$urls{en} ? $urls{en} :
@urls ? $urls[0]->textContent() :
undef;
}
} elsif ($child->localname() eq 'Extensions') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment