diff --git a/src/archive/zip.rs b/src/archive/zip.rs index b331b54c1..01e6d25dc 100644 --- a/src/archive/zip.rs +++ b/src/archive/zip.rs @@ -261,14 +261,15 @@ fn get_last_modified_time(file: &fs::File) -> DateTime { } fn set_last_modified_time(zip_file: &ZipFile, path: &Path) -> crate::Result<()> { - let modification_time_in_seconds = zip_file - .last_modified() - .to_time() - .expect("Zip archive contains a file with broken 'last modified time'") - .unix_timestamp(); + let modification_time = zip_file.last_modified().to_time(); + + let time_in_seconds = match modification_time { + Ok(inner) => inner.unix_timestamp(), + _ => return Ok(()), + }; // Zip does not support nanoseconds, so we can assume zero here - let modification_time = FileTime::from_unix_time(modification_time_in_seconds, 0); + let modification_time = FileTime::from_unix_time(time_in_seconds, 0); set_file_mtime(path, modification_time)?;