Merge pull request #21038 from jfrazelle/patch-for-bump

[bump_branch]: only add the suites that exist we dont need the script for this
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e631512..97c9fb0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,7 +16,8 @@
 
 ### Distribution
 
-- Fix a crash when pushing multiple images sharing the same layers to the same repository in parallel  [#20831](https://github.com/docker/docker/pull/20831)
+- Fix a crash when pushing multiple images sharing the same layers to the same repository in parallel [#20831](https://github.com/docker/docker/pull/20831)
+- Fix a panic when pushing images to a registry which uses a misconfigured token service [#21030](https://github.com/docker/docker/pull/21030)
 
 ### Plugin system
 
diff --git a/distribution/registry.go b/distribution/registry.go
index 1c2b4f3..ac2964f 100644
--- a/distribution/registry.go
+++ b/distribution/registry.go
@@ -140,7 +140,9 @@
 func retryOnError(err error) error {
 	switch v := err.(type) {
 	case errcode.Errors:
-		return retryOnError(v[0])
+		if len(v) != 0 {
+			return retryOnError(v[0])
+		}
 	case errcode.Error:
 		switch v.Code {
 		case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeUnsupported, errcode.ErrorCodeDenied: