aboutsummaryrefslogtreecommitdiff
path: root/models/issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go4
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 {