summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-24 15:34:02 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-24 15:34:02 -0400
commit87854c95a90cf1bebe1bffb833389471fb35f234 (patch)
tree95888810bd31f3fb99e16c646777636df96f950b /models
parent80055bde86c21f1245a7b45ba30406db7640fec0 (diff)
downloadgitea-87854c95a90cf1bebe1bffb833389471fb35f234.tar.gz
gitea-87854c95a90cf1bebe1bffb833389471fb35f234.zip
Fixed #200
Diffstat (limited to 'models')
-rw-r--r--models/issue.go4
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 {