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 1819512073.
This commit is contained in:
Josselin Poiret 2023-06-06 13:18:46 +02:00
parent 0ae29db11d
commit 1a2eb26286
No known key found for this signature in database
GPG key ID: 505E40B916171A8A

View file

@ -343,12 +343,14 @@ (define (apply-clauses clauses services)
((head . tail) ((head . tail)
(let ((service clauses (let ((service clauses
(fold2 (lambda (clause service remainder) (fold2 (lambda (clause service remainder)
(match clause (if service
((kind proc properties) (match clause
(if (eq? kind (service-kind service)) ((kind proc properties)
(values (proc service) remainder) (if (eq? kind (service-kind service))
(values service (values (proc service) remainder)
(cons clause remainder)))))) (values service
(cons clause remainder)))))
(values #f (cons clause remainder))))
head head
'() '()
clauses))) clauses)))