summaryrefslogtreecommitdiffstats
path: root/modules/markup/common/linkify.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-02-28 00:10:27 +0100
committerGitHub <noreply@github.com>2020-02-27 20:10:27 -0300
commite57ac841de1fc93df15ba8bef280077bbb733bf1 (patch)
treed81462a68ee6ae6276ae14ef0b3ccc7c0d77ada7 /modules/markup/common/linkify.go
parent15fbf509d3475cef3f8a7e994b59e4d78fd1c508 (diff)
downloadgitea-e57ac841de1fc93df15ba8bef280077bbb733bf1.tar.gz
gitea-e57ac841de1fc93df15ba8bef280077bbb733bf1.zip
Fix potential bugs (#10513)
* use e if it is an option * potential nil so check err first * check err first * m == nil already checked
Diffstat (limited to 'modules/markup/common/linkify.go')
-rw-r--r--modules/markup/common/linkify.go2
1 files changed, 1 insertions, 1 deletions
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]