summary refs log tree commit diff
diff options
context:
space:
mode:
authorJosselin Poiret <dev@jpoiret.xyz>2023-06-06 13:18:46 +0200
committerJosselin Poiret <dev@jpoiret.xyz>2023-06-06 13:38:35 +0200
commit1a2eb26286c72ac2754969f53f5833b053b96b67 (patch)
tree0b3a11eb4174668e566b8527a14515348d655b5a
parent0ae29db11d0c4a92d12b6cc604c868882336aced (diff)
downloadguix-1a2eb26286c72ac2754969f53f5833b053b96b67.tar.gz
services: Check if service is #f before applying clause.
* gnu/services.scm (apply-clauses): Check if service is #f before trying to
apply clause.  Follow up of 181951207339508789b28ba7cb914f983319920f.
-rw-r--r--gnu/services.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/gnu/services.scm b/gnu/services.scm
index 5410d31971..109e050a23 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -343,12 +343,14 @@ used."
       ((head . tail)
        (let ((service clauses
                       (fold2 (lambda (clause service remainder)
-                               (match clause
-                                 ((kind proc properties)
-                                  (if (eq? kind (service-kind service))
-                                      (values (proc service) remainder)
-                                      (values service
-                                              (cons clause remainder))))))
+                               (if service
+                                   (match clause
+                                     ((kind proc properties)
+                                      (if (eq? kind (service-kind service))
+                                          (values (proc service) remainder)
+                                          (values service
+                                                  (cons clause remainder)))))
+                                   (values #f (cons clause remainder))))
                              head
                              '()
                              clauses)))