aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-07-12 19:50:48 +0100
committerChristopher Baines <mail@cbaines.net>2019-07-12 19:50:48 +0100
commit8f956aa6c20c093199f028fffec4ae68ef5ddfa9 (patch)
treec49232bb345a7b8d8d495f738a0cdac656d8b557
parent28baed266766fe67deb03bc1f71631cdf09e650c (diff)
downloaddata-service-8f956aa6c20c093199f028fffec4ae68ef5ddfa9.tar
data-service-8f956aa6c20c093199f028fffec4ae68ef5ddfa9.tar.gz
Fix a bug where the list of 0 licenses wasn't handled correctly
This happened for a package with #f as the licenses. That's incorrect, but try to handle it without erroring.
-rw-r--r--guix-data-service/model/license-set.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/guix-data-service/model/license-set.scm b/guix-data-service/model/license-set.scm
index 44c0a70..61ded10 100644
--- a/guix-data-service/model/license-set.scm
+++ b/guix-data-service/model/license-set.scm
@@ -37,10 +37,13 @@ FROM license_sets")
(exec-query->vhash conn
select-license-sets
(lambda (results)
- (string-split (string-drop-right
- (string-drop (second results) 1)
- 1)
- #\,))
+ (if (string=? (second results) "{}")
+ '()
+ (string-split
+ (string-drop-right
+ (string-drop (second results) 1)
+ 1)
+ #\,)))
first)) ;; id
(missing-license-sets
(delete-duplicates