Skip to content

Commit 6acba82

Browse files
committed
fix: get nil filename panic
1 parent 375e069 commit 6acba82

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lang/golang/parser/pkg.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ func (p *GoParser) loadPackages(mod *Module, dir string, pkgPath PkgPath) (err e
245245
if skip {
246246
continue
247247
}
248+
if filePath == "" {
249+
fmt.Fprintf(os.Stderr, "filename is empty, pkg: %s\n", pkg.ID)
250+
continue
251+
}
248252
bs := p.getFileBytes(filePath)
249253
ctx := &fileContext{
250254
repoDir: p.homePageDir,

0 commit comments

Comments
 (0)