Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit af6baa5

Browse files
committed
workaround crash
1 parent 91ac29a commit af6baa5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

stylecheck/lint.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ func (c *Checker) CheckUnexportedReturn(j *lint.Job) {
252252

253253
func (c *Checker) CheckReceiverNames(j *lint.Job) {
254254
for _, pkg := range j.Program.InitialPackages {
255+
if pkg.SSA == nil {
256+
continue
257+
}
255258
for _, m := range pkg.SSA.Members {
256259
if T, ok := m.Object().(*types.TypeName); ok && !T.IsAlias() {
257260
ms := typeutil.IntuitiveMethodSet(T.Type(), nil)
@@ -276,6 +279,10 @@ func (c *Checker) CheckReceiverNames(j *lint.Job) {
276279

277280
func (c *Checker) CheckReceiverNamesIdentical(j *lint.Job) {
278281
for _, pkg := range j.Program.InitialPackages {
282+
if pkg.SSA == nil {
283+
continue
284+
}
285+
279286
for _, m := range pkg.SSA.Members {
280287
names := map[string]int{}
281288

0 commit comments

Comments
 (0)