Skip to content

Commit d66881b

Browse files
committed
Fix compilation.
1 parent 057ba3f commit d66881b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

massa-client/src/cmds.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,15 @@ impl Command {
615615
Ok(node_status) => node_status.config.end_timestamp,
616616
Err(e) => bail!("RpcError: {}", e),
617617
};
618-
let (days, hours, mins, secs) = end
619-
.saturating_sub(MassaTime::now()?)
620-
.days_hours_mins_secs()?; // compensation millis is zero
621618
let mut res = "".to_string();
622-
res.push_str(&format!("{} days, {} hours, {} minutes, {} seconds remaining until the end of the current episode", days, hours, mins, secs));
619+
if let Some(e) = end {
620+
let (days, hours, mins, secs) =
621+
e.saturating_sub(MassaTime::now()?).days_hours_mins_secs()?; // compensation millis is zero
622+
623+
res.push_str(&format!("{} days, {} hours, {} minutes, {} seconds remaining until the end of the current episode", days, hours, mins, secs));
624+
} else {
625+
res.push_str("There is no end !")
626+
}
623627
if !json {
624628
println!("{}", res);
625629
}

0 commit comments

Comments
 (0)