Skip to content

Commit 6262511

Browse files
committed
only add network param if provided
1 parent b3f3c3a commit 6262511

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rust-cli/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ enum Commands {
7272
async fn main() -> anyhow::Result<()> {
7373
let cli = Cli::parse();
7474
let mut rpc_params = jsonrpsee::core::params::ObjectParams::new();
75-
rpc_params
76-
.insert("network", &cli.network)
77-
.context("add network param")?;
75+
if let Some(network_value) = &cli.network {
76+
rpc_params
77+
.insert("network", network_value)
78+
.context("add network param")?;
79+
}
7880

7981
match &cli.command {
8082
Some(Commands::Debug { command }) => {

0 commit comments

Comments
 (0)