completion: ContainerNames: don't panic on nil filter

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit b8cddc63ad)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2024-10-13 17:47:07 +02:00
parent 099d4baeed
commit b6e7eba447
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ func ContainerNames(dockerCLI APIClientProvider, all bool, filters ...func(types
for _, ctr := range list { for _, ctr := range list {
skip := false skip := false
for _, fn := range filters { for _, fn := range filters {
if !fn(ctr) { if fn != nil && !fn(ctr) {
skip = true skip = true
break break
} }