From 42c0b131a2934c6244c9562b732e49e4c6fefb90 Mon Sep 17 00:00:00 2001 From: rink1969 Date: Sat, 18 Jul 2020 18:40:08 +0800 Subject: [PATCH] fix unwrap --- proof/src/bft_proof.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proof/src/bft_proof.rs b/proof/src/bft_proof.rs index 5dce5f35..503dc68f 100644 --- a/proof/src/bft_proof.rs +++ b/proof/src/bft_proof.rs @@ -129,7 +129,8 @@ impl BftProof { impl From for BftProof { fn from(p: Proof) -> Self { - let decoded: BftProof = deserialize(&p.get_content()[..]).unwrap(); + let decoded: BftProof = + deserialize(&p.get_content()[..]).unwrap_or_else(|_| BftProof::default()); decoded } }