From 0cfa3d3de70804e45ac415e109c4a7924f8e5057 Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Fri, 25 Oct 2019 16:44:09 -0500 Subject: [PATCH] Return error if stake history deser fails in cli (#6559) --- cli/src/stake.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/src/stake.rs b/cli/src/stake.rs index 7506f11e57..b59c86213e 100644 --- a/cli/src/stake.rs +++ b/cli/src/stake.rs @@ -597,7 +597,9 @@ pub fn process_show_stake_history( use_lamports_unit: bool, ) -> ProcessResult { let stake_history_account = rpc_client.get_account(&stake_history::id())?; - let stake_history = StakeHistory::from_account(&stake_history_account).unwrap(); + let stake_history = StakeHistory::from_account(&stake_history_account).ok_or_else(|| { + CliError::RpcRequestError("Failed to deserialize stake history".to_string()) + })?; println!(); println!(