packages: 'package-field-location' handles missing source properties.

This is a followup to f2b24f01f4.

* guix/packages.scm (package-field-location): Check whether
'source-properties->location' returns #f.  This fixes the case where
'source-properties' returns the empty list.
This commit is contained in:
Ludovic Courtès 2020-03-22 12:31:07 +01:00
parent 3e6f65be7a
commit 91601790d0
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -363,12 +363,12 @@ object."
(let ((field (assoc field inits)))
(match field
((_ value)
(let ((props (source-properties value)))
(and props
(let ((loc (and=> (source-properties value)
source-properties->location)))
(and loc
;; Preserve the original file name, which may be a
;; relative file name.
(let ((loc (source-properties->location props)))
(set-field loc (location-file) file)))))
(set-field loc (location-file) file))))
(_
#f))))
(_