summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Helper/Marudor.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-03-20 13:23:33 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-03-20 13:23:33 +0100
commitbb89800fd5b970c5b12ecfe2ad2318874c97793f (patch)
tree376fc065ec94e38b22a44f6c1ab879207a15aa33 /lib/DBInfoscreen/Helper/Marudor.pm
parentc0c77e9020b0a0700da55b170d03877031fd57f6 (diff)
HAFAS, Marudor: Handle empty responses
Diffstat (limited to 'lib/DBInfoscreen/Helper/Marudor.pm')
-rw-r--r--lib/DBInfoscreen/Helper/Marudor.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Helper/Marudor.pm b/lib/DBInfoscreen/Helper/Marudor.pm
index 21083a7..dad9dc7 100644
--- a/lib/DBInfoscreen/Helper/Marudor.pm
+++ b/lib/DBInfoscreen/Helper/Marudor.pm
@@ -55,6 +55,13 @@ sub get_json_p {
my $res = $tx->res->json;
+ if ( not $res ) {
+ $self->{log}
+ ->debug("marudor->get_json_p($url): empty response");
+ $promise->reject("GET $url returned empty response");
+ return;
+ }
+
$cache->freeze( $url, $res );
$promise->resolve($res);