diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-24 15:34:02 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-24 15:34:02 -0400 |
commit | 87854c95a90cf1bebe1bffb833389471fb35f234 (patch) | |
tree | 95888810bd31f3fb99e16c646777636df96f950b /models | |
parent | 80055bde86c21f1245a7b45ba30406db7640fec0 (diff) | |
download | gitea-87854c95a90cf1bebe1bffb833389471fb35f234.tar.gz gitea-87854c95a90cf1bebe1bffb833389471fb35f234.zip |
Fixed #200
Diffstat (limited to 'models')
-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 d0a65298b2..18057985f0 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 { |