diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-04-06 21:51:00 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-04-06 21:51:00 +0200 |
commit | 7324ee46e037910a718da459759ffdb6888507ec (patch) | |
tree | 5b7829a021d6b74701beef92f7b3deaefd2c5da0 /lib | |
parent | a0aa210f82a9e50068f0b9114ff4f1bd432c0023 (diff) |
set errstr when receiving an empty response
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/DBWagenreihung.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index ce8cc63..cadee0b 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -77,6 +77,13 @@ sub get_wagonorder { return; } + if ( @{ $json->{data}{istformation}{allFahrzeuggruppe} // [] } == 0 + and @{ $json->{data}{istformation}{halt} // [] } == 0 ) + { + $self->{errstr} = 'No wagon order available'; + return; + } + $self->{data} = $json->{data}; $self->{meta} = $json->{meta}; } |