Don't panic on uknown git commit hash (#4231)
This commit is contained in:
parent
685c630b4d
commit
35666f718b
@ -17,8 +17,9 @@
|
|||||||
//! Types used in the public API
|
//! Types used in the public API
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
use std::str::FromStr;
|
||||||
use semver::{Version};
|
use semver::{Version};
|
||||||
use util::{H160};
|
use util::{H160, FixedHash};
|
||||||
use util::misc::raw_package_info;
|
use util::misc::raw_package_info;
|
||||||
use release_track::ReleaseTrack;
|
use release_track::ReleaseTrack;
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ impl VersionInfo {
|
|||||||
VersionInfo {
|
VersionInfo {
|
||||||
track: raw.0.into(),
|
track: raw.0.into(),
|
||||||
version: { let mut v = Version::parse(raw.1).expect("Environment variables are known to be valid; qed"); v.build = vec![]; v.pre = vec![]; v },
|
version: { let mut v = Version::parse(raw.1).expect("Environment variables are known to be valid; qed"); v.build = vec![]; v.pre = vec![]; v },
|
||||||
hash: raw.2.into(),
|
hash: H160::from_str(raw.2).unwrap_or_else(|_| H160::zero()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user