summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--guix/store.scm10
1 files changed, 6 insertions, 4 deletions
diff --git a/guix/store.scm b/guix/store.scm
index e0b15abce3..81bb9eb847 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -2173,10 +2173,12 @@ valid inputs."
 (define (store-path-hash-part path)
   "Return the hash part of PATH as a base32 string, or #f if PATH is not a
 syntactically valid store path."
-  (let* ((base (store-path-base path))
-         (hash (string-take base 32)))
-    (and (string-every %nix-base32-charset hash)
-         hash)))
+  (match (store-path-base path)
+    (#f #f)
+    (base
+     (let ((hash (string-take base 32)))
+       (and (string-every %nix-base32-charset hash)
+            hash)))))
 
 (define (derivation-log-file drv)
   "Return the build log file for DRV, a derivation file name, or #f if it