summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Helper/HAFAS.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/DBInfoscreen/Helper/HAFAS.pm')
-rw-r--r--lib/DBInfoscreen/Helper/HAFAS.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Helper/HAFAS.pm b/lib/DBInfoscreen/Helper/HAFAS.pm
index b97248d..2b8172e 100644
--- a/lib/DBInfoscreen/Helper/HAFAS.pm
+++ b/lib/DBInfoscreen/Helper/HAFAS.pm
@@ -62,6 +62,12 @@ sub get_json_p {
my $json = decode_json($body);
+ if ( not $json ) {
+ $self->{log}->debug("hafas->get_json_p($url): empty response");
+ $promise->reject("GET $url returned empty response");
+ return;
+ }
+
$cache->freeze( $url, $json );
$promise->resolve($json);