summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DBWagenreihung.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-06 21:51:00 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-06 21:51:00 +0200
commit7324ee46e037910a718da459759ffdb6888507ec (patch)
tree5b7829a021d6b74701beef92f7b3deaefd2c5da0 /lib/Travel/Status/DE/DBWagenreihung.pm
parenta0aa210f82a9e50068f0b9114ff4f1bd432c0023 (diff)
set errstr when receiving an empty response
Diffstat (limited to 'lib/Travel/Status/DE/DBWagenreihung.pm')
-rw-r--r--lib/Travel/Status/DE/DBWagenreihung.pm7
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};
}