index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
models
/
issue.go
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
Diffstat
(limited to 'models/issue.go')
-rw-r--r--
models/issue.go
4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index d0a65298..18057985 100644
--- a/
models/issue.go
+++ b/
models/issue.go
@@ -473,6 +473,10 @@ func NewLabel(l *Label) error {
// GetLabelById returns a label by given ID.
func GetLabelById(id int64) (*Label, error) {
+ if id <= 0 {
+ return nil, ErrLabelNotExist
+ }
+
l := &Label{Id: id}
has, err := orm.Get(l)
if err != nil {