x/pkgsite: panic for some packages with syntax errors with locally running pkgsite #73377
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
pkgsite
Milestone
What is the URL of the page with the issue?
http://localhost:8080/github.com/mjl-/mox
What is your user agent?
firefox (not relevant)
Screenshot
What did you do?
To reproduce, create a local directory somewhere, with two files (the form of the module path seems relevant):
Malformed go file:
Run latest pkgsite:
Open http://localhost:8080/github.com/mjl-/mox
What did you see happen?
An error message about the invalid package.
What did you expect to see?
An aborted HTTP request due to an unhandled panic of a nil pointer dereference:
The nil pointer dereference is at https://github.com/golang/pkgsite/blob/01dc430a4e8339c44b283f075264c5c5dd47621c/internal/fetchdatasource/fetchdatasource.go#L161
The nil
u
is coming from https://github.com/golang/pkgsite/blob/01dc430a4e8339c44b283f075264c5c5dd47621c/internal/fetchdatasource/fetchdatasource.go#L233 (nilunit
)The text was updated successfully, but these errors were encountered: