Bug fixed for deleted label in issue comment (#904)

* bug fixed for deleted label in issue comment

* fix indent
This commit is contained in:
Lunny Xiao authored and GitHub committed 2017-02-11 20:56:57 +08:00
1 parent 442145dbd3
commit 8a0be5e9f0
3 files changed
+21 -13

No files matched your search

+6 -5
View File
@@ -214,12 +214,13 @@ func (c *Comment) LoadLabel() error {
has, err := x.ID(c.LabelID).Get(&label)
if err != nil {
return err
} else if !has {
return ErrLabelNotExist{
LabelID: c.LabelID,
}
} else if has {
c.Label = &label
} else {
// Ignore Label is deleted, but not clear this table
log.Warn("Commit %d cannot load label %d", c.ID, c.LabelID)
}
c.Label = &label
return nil
}