diff --git a/src/SharpCompress/Common/IEntry.Extensions.cs b/src/SharpCompress/Common/IEntry.Extensions.cs index 7e9b79a3..7f0cda43 100644 --- a/src/SharpCompress/Common/IEntry.Extensions.cs +++ b/src/SharpCompress/Common/IEntry.Extensions.cs @@ -23,17 +23,38 @@ internal static class EntryExtensions { if (entry.CreatedTime.HasValue) { - nf.CreationTime = entry.CreatedTime.Value; + try + { + nf.CreationTime = entry.CreatedTime.Value; + } + catch + { + // Invalid time or the OS rejected + } } if (entry.LastModifiedTime.HasValue) { - nf.LastWriteTime = entry.LastModifiedTime.Value; + try + { + nf.LastWriteTime = entry.LastModifiedTime.Value; + } + catch + { + // Invalid time or the OS rejected + } } if (entry.LastAccessedTime.HasValue) { - nf.LastAccessTime = entry.LastAccessedTime.Value; + try + { + nf.LastAccessTime = entry.LastAccessedTime.Value; + } + catch + { + // Invalid time or the OS rejected + } } }