From 6356ee59749b4d73704b2590a1b4a099631a7124 Mon Sep 17 00:00:00 2001 From: Zek Date: Tue, 13 Aug 2024 04:37:41 +0800 Subject: [PATCH] Fix bug. --- src/evm/blaz/builder.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/evm/blaz/builder.rs b/src/evm/blaz/builder.rs index 8046d9155..711c73a5f 100644 --- a/src/evm/blaz/builder.rs +++ b/src/evm/blaz/builder.rs @@ -183,10 +183,16 @@ impl BuildJobResult { let resp = client.get(&url).send().expect("retrieve onchain job failed"); let json = serde_json::from_str::(&resp.text().expect("parse json failed")).expect("parse json failed"); - if !json["success"].as_bool().expect("get status failed") { - error!("retrieve onchain job failed for {:?}", url); + if let Some(success) = json["success"].as_bool() { + if !success { + error!("retrieve onchain job failed for {:?}", url); + return None; + } + } else { + error!("retrieve onchain job status failed for {:?}", url); return None; } + Self::from_json(&json) }