diff --git a/cli/command/registry.go b/cli/command/registry.go index 92ea17f90c..b2696d7b1d 100644 --- a/cli/command/registry.go +++ b/cli/command/registry.go @@ -150,10 +150,11 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword if argUser == "" { argUser = defaultUsername } + if argUser == "" { + return registrytypes.AuthConfig{}, errors.Errorf("Error: Non-null Username Required") + } } - if argUser == "" { - return registrytypes.AuthConfig{}, errors.Errorf("Error: Non-null Username Required") - } + if argPassword == "" { restoreInput, err := DisableInputEcho(cli.In()) if err != nil {