diff --git a/cli/command/registry.go b/cli/command/registry.go index 51fff10c5f..11fad3fe1f 100644 --- a/cli/command/registry.go +++ b/cli/command/registry.go @@ -152,10 +152,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 {