From 90e1778cd207c56e7161f34d1f08dffc5cb3e63d Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Thu, 21 Jan 2021 23:58:34 -0700 Subject: [PATCH] CLI: Allow missing pubkey in `--verbose` config output --- cli/src/cli.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/src/cli.rs b/cli/src/cli.rs index 332ddfeb97..e183ca35bb 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -1165,7 +1165,11 @@ pub fn process_command(config: &CliConfig) -> ProcessResult { println_name_value("RPC URL:", &config.json_rpc_url); println_name_value("Default Signer Path:", &config.keypair_path); if config.keypair_path.starts_with("usb://") { - println_name_value("Pubkey:", &format!("{:?}", config.pubkey()?)); + let pubkey = config + .pubkey() + .map(|pubkey| format!("{:?}", pubkey)) + .unwrap_or_else(|_| "Unavailable".to_string()); + println_name_value("Pubkey:", &pubkey); } println_name_value("Commitment:", &config.commitment.commitment.to_string()); }