diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm index fd3cfa8444..a52b39a085 100644 --- a/guix/import/launchpad.scm +++ b/guix/import/launchpad.scm @@ -110,15 +110,14 @@ (define (pre-release? x) char-set:digit) (assoc-ref x "version")))) - (assoc-ref - (last (remove - pre-release? - (vector->list - (assoc-ref (json-fetch - (string-append "https://api.launchpad.net/1.0/" - package-name "/releases")) - "entries")))) - "version")) + (match (json-fetch + (string-append "https://api.launchpad.net/1.0/" + package-name "/releases")) + (#f #f) ;404 or similar + (json + (assoc-ref + (last (remove pre-release? (vector->list (assoc-ref json "entries")))) + "version")))) (define (latest-release pkg) "Return an for the latest release of PKG."