chiark / gitweb /
dgit: WWW::Curl: Double check that $response_body was set
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 8 Aug 2019 11:30:56 +0000 (12:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 10 Aug 2019 23:09:28 +0000 (00:09 +0100)
We are making some assumptions about how WWW::Curl behaves. This
confess, with appropriate tests, should catch any future problems.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index f7b5025f5717e4565115c2c6023368b9d3f64d3e..4bd2e0534ff21e14f564f0a7eefa81f5e380fe5f 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1223,6 +1223,8 @@ sub url_fetch ($;@) {
     
     fail f_ "fetch of %s gave HTTP code %s", $url, $code
        unless $url =~ m#^file://# or $code =~ m/^2/;
+
+    confess unless defined $response_body;
     return $response_body;
 }