From 3eac2960f228e1312ded9a78f74d354e9acce901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Le=C5=9Bniak?= Date: Tue, 21 Nov 2023 10:22:21 +0100 Subject: [PATCH] done --- finality-aleph/src/party/backup.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/finality-aleph/src/party/backup.rs b/finality-aleph/src/party/backup.rs index e99d5cf75e..b660eeab5f 100644 --- a/finality-aleph/src/party/backup.rs +++ b/finality-aleph/src/party/backup.rs @@ -128,6 +128,9 @@ pub fn rotate( /// This should be done at the beginning of the new session. pub fn remove_old_backups(path: Option, current_session: u32) -> io::Result<()> { if let Some(path) = path { + if !path.exists() { + return Ok(()); + } for read_dir in fs::read_dir(path)? { let item = read_dir?; match item.file_name().to_str() {