From 977da07879a3d259ea4095bba41ac148b0c576f5 Mon Sep 17 00:00:00 2001 From: Twacqwq Date: Mon, 20 Oct 2025 16:51:31 +0800 Subject: [PATCH] fix(1891): add length check to prevent index out of range in MangleScopedPackageName --- internal/module/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/module/util.go b/internal/module/util.go index 7f6d093d05..04f75150f4 100644 --- a/internal/module/util.go +++ b/internal/module/util.go @@ -45,7 +45,7 @@ func ParsePackageName(moduleName string) (packageName, rest string) { } func MangleScopedPackageName(packageName string) string { - if packageName[0] == '@' { + if len(packageName) > 0 && packageName[0] == '@' { idx := strings.Index(packageName, "/") if idx == -1 { return packageName