From 2b0a8427e6995eefddf09919ad48a7887e999965 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 30 May 2017 01:20:37 +0200 Subject: [PATCH] lib/string: make `isStorePath` total (#26216) fix #9278 --- lib/strings.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/strings.nix b/lib/strings.nix index d48624257cf..1cc633c729d 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -438,8 +438,13 @@ rec { => true isStorePath pkgs.python => true + isStorePath [] || isStorePath 42 || isStorePath {} || … + => false */ - isStorePath = x: builtins.substring 0 1 (toString x) == "/" && dirOf (builtins.toPath x) == builtins.storeDir; + isStorePath = x: + builtins.isString x + && builtins.substring 0 1 (toString x) == "/" + && dirOf (builtins.toPath x) == builtins.storeDir; /* Convert string to int Obviously, it is a bit hacky to use fromJSON that way.