From 37705a55524bd7abb3ff3d1ffa0fb6e17d0048ae Mon Sep 17 00:00:00 2001 From: Joel Lau Date: Tue, 5 Nov 2024 13:50:30 +0800 Subject: [PATCH] check for empty path Signed-off-by: Joel Lau --- internal/backend/crypto/age/ssh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/backend/crypto/age/ssh.go b/internal/backend/crypto/age/ssh.go index 85af37bec7..d256ae068b 100644 --- a/internal/backend/crypto/age/ssh.go +++ b/internal/backend/crypto/age/ssh.go @@ -69,7 +69,7 @@ func (a *Age) getSSHIdentities(ctx context.Context) (map[string]age.Identity, er func getSSHDir() (string, error) { preferredPath := os.Getenv("GOPASS_SSH_DIR") sshDir := filepath.Join(preferredPath, ".ssh") - if fsutil.IsDir(sshDir) { + if preferredPath != "" && fsutil.IsDir(sshDir) { return preferredPath, nil }