From bb59df9134351dba70c516b015ee8c41d1e9040b Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 16 Jun 2020 11:25:54 +0200 Subject: [PATCH] catalog: don't panic on invalid file mtimes Signed-off-by: Wolfgang Bumiller --- src/backup/catalog.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backup/catalog.rs b/src/backup/catalog.rs index 6f6e3a7b..9ccff29f 100644 --- a/src/backup/catalog.rs +++ b/src/backup/catalog.rs @@ -518,7 +518,10 @@ impl CatalogReader { self.dump_dir(&path, pos)?; } CatalogEntryType::File => { - let dt = Local.timestamp(mtime as i64, 0); + let dt = Local + .timestamp_opt(mtime as i64, 0) + .single() // chrono docs say timestamp_opt can only be None or Single! + .unwrap_or_else(|| Local.timestamp(0, 0)); println!( "{} {:?} {} {}",