[FIX] fix get version by event maybe nil error

This commit is contained in:
bay1ts 2017-12-04 12:43:57 +08:00
parent 47ac6f9351
commit f94f9af7b9

View File

@ -256,7 +256,11 @@ func (e *exectorManager) appBuild(in []byte) {
}
func updateBuildResult(eventID,finalStatus,dest string) {
if dest == ""||!strings.Contains(dest,"y") {
v,_:=db.GetManager().VersionInfoDao().GetVersionByEventID(eventID)
v,err:=db.GetManager().VersionInfoDao().GetVersionByEventID(eventID)
if err != nil {
logrus.Errorf("error get version by eventID %s from db,details %s",eventID,err.Error())
return
}
v.FinalStatus=finalStatus
db.GetManager().VersionInfoDao().UpdateModel(v)
}