Don't panic on vintage files (#33543)
Release Notes: - remoting: Fix a crash on the remote side when encountering files from before 1970.
This commit is contained in:
@@ -632,7 +632,7 @@ impl From<Timestamp> for SystemTime {
|
||||
|
||||
impl From<SystemTime> for Timestamp {
|
||||
fn from(time: SystemTime) -> Self {
|
||||
let duration = time.duration_since(UNIX_EPOCH).unwrap();
|
||||
let duration = time.duration_since(UNIX_EPOCH).unwrap_or_default();
|
||||
Self {
|
||||
seconds: duration.as_secs(),
|
||||
nanos: duration.subsec_nanos(),
|
||||
|
||||
Reference in New Issue
Block a user