1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #18485 from aaronlehmann/errors-bounds-check

Add missing bounds check in ContinueOnError
This commit is contained in:
Alexander Morozov 2015-12-08 12:40:55 -08:00
commit 591493bfb5

View file

@ -213,6 +213,9 @@ func (e ErrNoSupport) Error() string {
func ContinueOnError(err error) bool { func ContinueOnError(err error) bool {
switch v := err.(type) { switch v := err.(type) {
case errcode.Errors: case errcode.Errors:
if len(v) == 0 {
return true
}
return ContinueOnError(v[0]) return ContinueOnError(v[0])
case ErrNoSupport: case ErrNoSupport:
return ContinueOnError(v.Err) return ContinueOnError(v.Err)