Fix potential bugs (#10513)
* use e if it is an option * potential nil so check err first * check err first * m == nil already checked
This commit is contained in:
parent
15fbf509d3
commit
e57ac841de
7 changed files with 14 additions and 10 deletions
|
@ -108,7 +108,7 @@ func (s *linkifyParser) Parse(parent ast.Node, block text.Reader, pc parser.Cont
|
|||
}
|
||||
at := bytes.IndexByte(line, '@')
|
||||
m = []int{0, stop, at, stop - 1}
|
||||
if m == nil || bytes.IndexByte(line[m[2]:m[3]], '.') < 0 {
|
||||
if bytes.IndexByte(line[m[2]:m[3]], '.') < 0 {
|
||||
return nil
|
||||
}
|
||||
lastChar := line[m[1]-1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue