added error check for dependency exists function

Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
Konrad Langenberg 2017-09-23 14:29:41 +02:00 committed by Konrad
parent 0eaf0404cc
commit 1f8ce67366

View File

@ -127,12 +127,20 @@ func issueDepExists(e Engine, issueID int64, depID int64) (exists bool, err erro
exists, err = e.Get(&Dependencies)
if err != nil {
return exists, err
}
// Check for dependencies the other way around
// Otherwise two issues could block each other which would result in none of them could be closed.
if !exists {
Dependencies.IssueID = depID
Dependencies.DependencyID = issueID
exists, err = e.Get(&Dependencies)
if err != nil {
return exists, err
}
}
return