From e57ac841de1fc93df15ba8bef280077bbb733bf1 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 28 Feb 2020 00:10:27 +0100 Subject: Fix potential bugs (#10513) * use e if it is an option * potential nil so check err first * check err first * m == nil already checked --- modules/markup/common/linkify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/markup/common') diff --git a/modules/markup/common/linkify.go b/modules/markup/common/linkify.go index 6ae70fba34..25621bf801 100644 --- a/modules/markup/common/linkify.go +++ b/modules/markup/common/linkify.go @@ -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] -- cgit v1.2.3