aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-data-service/model/derivation.scm23
1 files changed, 12 insertions, 11 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index 4efda3a..d95e285 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -1652,17 +1652,18 @@ LIMIT $1"
(simple-format
#t "debug: insert-missing-derivations: inserting sources\n")
(for-each (lambda (derivation-id derivation)
- (let* ((sources (derivation-sources derivation))
- (sources-ids
- (insert-derivation-sources conn
- derivation-id
- sources)))
- (map (lambda (id source-file)
- (insert-derivation-source-file-nar conn
- id
- source-file))
- sources-ids
- sources)))
+ (let ((sources (derivation-sources derivation)))
+ (unless (null? sources)
+ (let ((sources-ids
+ (insert-derivation-sources conn
+ derivation-id
+ sources)))
+ (map (lambda (id source-file)
+ (insert-derivation-source-file-nar conn
+ id
+ source-file))
+ sources-ids
+ sources)))))
derivation-ids
derivations)