diff options
author | Daniel Friesel <derf@finalrewind.org> | 2015-07-31 00:05:54 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2015-07-31 00:05:54 +0200 |
commit | ae24879b2a079a745b7e726355736cd94c1ec013 (patch) | |
tree | bfd279243e56e772e2242bc86e47a02ab637fea0 /lib | |
parent | d87916aef53793b6947b4572ba3db33c0f148499 (diff) |
EFA: Handle empty XML results (LibXML does not like them)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/EFA.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index 53d2119..4a99742 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -127,6 +127,13 @@ sub new { $self->{xml} = $response->decoded_content; + if ( not $self->{xml} ) { + + # LibXML doesn't like empty documents + $self->{errstr} = 'Server returned nothing (empty result)'; + return $self; + } + $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); |