Skip to content

Commit

Permalink
fix(rust): fix is_node_up panic
Browse files Browse the repository at this point in the history
  • Loading branch information
SanjoDeundiak committed Jan 4, 2024
1 parent d6df002 commit 72da453
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions implementations/rust/ockam/ockam_command/src/node/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ pub async fn is_node_up(
for timeout_duration in retries {
// The node is down if its default tcp listener has not been started yet
let node = node_client.cli_state().get_node(&node_name).await.ok();
if let Some(node) = node {
if node.tcp_listener_address().is_none() {
trace!(%node_name, "node has not been initialized");
tokio::time::sleep(timeout_duration).await;
continue;
}
let node_tcp_listener_address = node.as_ref().and_then(|n| n.tcp_listener_address());

if node.is_none() || node_tcp_listener_address.is_none() {
trace!(%node_name, "node has not been initialized");
tokio::time::sleep(timeout_duration).await;
continue;
}

// Test if node is up
Expand Down

0 comments on commit 72da453

Please sign in to comment.