From 9cd20e8654fd7e40235f50239bf5f3bfc577fc10 Mon Sep 17 00:00:00 2001 From: Tau Date: Fri, 22 Nov 2024 00:42:30 +0100 Subject: [PATCH] fixes issue with moving inexistant folder If one of the legacy folders in the integrity check didn't exist it would try to move it anyway. --- core/integrity.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/integrity.go b/core/integrity.go index d4a0eaed..8aa4401e 100644 --- a/core/integrity.go +++ b/core/integrity.go @@ -156,7 +156,7 @@ func fixupOlderSystems(rootPath string) (err error) { legacyPath := filepath.Join(rootPath, path) newPath := filepath.Join("/var", path) - if info, err := os.Lstat(legacyPath); err != nil || info.IsDir() { + if info, err := os.Lstat(legacyPath); err == nil && info.IsDir() { err = exec.Command("mv", legacyPath, newPath).Run() if err != nil { PrintVerboseErr("fixupOlderSystems", 1, "could not move ", legacyPath, " to ", newPath, " : ", err)