From 8a0be5e9f01caaf3667c420f08541ac7c26127b8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 11 Feb 2017 20:56:57 +0800 Subject: Bug fixed for deleted label in issue comment (#904) * bug fixed for deleted label in issue comment * fix indent --- models/issue_comment.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'models/issue_comment.go') diff --git a/models/issue_comment.go b/models/issue_comment.go index 2eadba810b..e133cc049b 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -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 } -- cgit v1.2.3