提交 5642e0a1 编写于 作者: D Derek Parker

Add nil check when following `Else` in ast

Fixes #137
上级 38f97b40
......@@ -120,6 +120,7 @@ func (s *Searcher) NextLines(fname string, line int) (lines []int, err error) {
x = stmt
continue
}
if x.Else != nil {
pos := s.fileset.Position(x.Else.Pos())
ast.Inspect(x, func(n ast.Node) bool {
if found {
......@@ -138,6 +139,7 @@ func (s *Searcher) NextLines(fname string, line int) (lines []int, err error) {
})
}
}
}
// Follow case statements.
//
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册