fix err returning

This commit is contained in:
bobemoe 2020-02-28 17:00:24 +00:00
parent 0334927da0
commit 308d613427

View File

@ -103,10 +103,16 @@ func CreateOrStopIssueStopwatch(user *User, issue *Issue) error {
} else { } else {
//if another stopwatch is running: stop it //if another stopwatch is running: stop it
exists, sw, err := HasUserStopwatch(user.ID) exists, sw, err := HasUserStopwatch(user.ID)
if exists && err==nil { if err != nil {
issue, err := getIssueByID(x, sw.IssueID) return err
if err == nil { }
CreateOrStopIssueStopwatch(user, issue) if exists {
issue, err := getIssueByID(x, sw.IssueID)
if err != nil {
return err
}
if err := CreateOrStopIssueStopwatch(user, issue) ; err != nil {
return err
} }
} }