Ver código fonte

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

Add missing bounds check in ContinueOnError
Alexander Morozov 9 anos atrás
pai
commit
591493bfb5
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      registry/registry.go

+ 3 - 0
registry/registry.go

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