From 74a0ff84a9a84f1468e5fca9d777ccb21e440d52 Mon Sep 17 00:00:00 2001 From: 0x5487 Date: Sun, 22 Feb 2026 22:20:43 +0800 Subject: [PATCH] fix: `validatePath` now returns an error when the workspace is empty. --- pkg/tools/filesystem.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tools/filesystem.go b/pkg/tools/filesystem.go index de473264e..37db8b4ae 100644 --- a/pkg/tools/filesystem.go +++ b/pkg/tools/filesystem.go @@ -13,7 +13,7 @@ import ( // validatePath ensures the given path is within the workspace if restrict is true. func validatePath(path, workspace string, restrict bool) (string, error) { if workspace == "" { - return path, nil + return path, fmt.Errorf("workspace is not defined") } absWorkspace, err := filepath.Abs(workspace)