mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-09 08:40:29 +00:00
fix: crash if the id tool fails to run in the container (1660)
This commit is contained in:
1 parent
aeee2052de
commit
f3c88b5091
2 files changed
+16
-1
No files matched your search
@@ -583,7 +583,7 @@ func (cr *containerReference) tryReadID(opt string, cbk func(id int)) common.Exe
|
||||
}
|
||||
exp := regexp.MustCompile(`\d+\n`)
|
||||
found := exp.FindString(sid)
|
||||
id, err := strconv.ParseInt(found[:len(found)-1], 10, 32)
|
||||
id, err := strconv.ParseInt(strings.TrimSpace(found), 10, 32)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user