Skip to content

Commit 6072793

Browse files
committed
pattern: guard against nil FieldList
1 parent e4b0780 commit 6072793

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pattern/match.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ func match(m *Matcher, l, r interface{}) (interface{}, bool) {
158158
case *ast.BlockStmt:
159159
return match(m, l.List, r)
160160
case *ast.FieldList:
161-
return match(m, l.List, r)
161+
if l == nil {
162+
return match(m, nil, r)
163+
} else {
164+
return match(m, l.List, r)
165+
}
162166
}
163167

164168
switch r := r.(type) {

0 commit comments

Comments
 (0)