From 7324ee46e037910a718da459759ffdb6888507ec Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 6 Apr 2019 21:51:00 +0200 Subject: set errstr when receiving an empty response --- lib/Travel/Status/DE/DBWagenreihung.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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}; } -- cgit v1.2.3