From 503ce29c844ae35caa445a01b445a8a483756565 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Mon, 3 Jun 2024 22:42:04 +0200 Subject: [PATCH] zerotier-static-peers: add guard condition --- clanModules/zerotier-static-peers/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clanModules/zerotier-static-peers/default.nix b/clanModules/zerotier-static-peers/default.nix index 31fe7d99..2d49dc16 100644 --- a/clanModules/zerotier-static-peers/default.nix +++ b/clanModules/zerotier-static-peers/default.nix @@ -20,7 +20,7 @@ let if builtins.pathExists fullPath then builtins.readFile fullPath else null ) machines; networkIds = lib.filter (machine: machine != null) networkIdsUnchecked; - networkId = builtins.elemAt networkIds 0; + networkId = if builtins.length networkIds == 0 then null else builtins.elemAt networkIds 0; in #TODO:trace on multiple found network-ids #TODO:trace on no single found networkId