Do not crash on partial calc interpolation

Fixes #12151

Fixes regression introduced by #11924
This commit is contained in:
Michael Howell 2016-07-01 21:02:28 -07:00
parent 1ed06777ee
commit f9a8fe0afe

View file

@ -329,8 +329,8 @@ impl Interpolate for CalcLengthOrPercentage {
#[inline] #[inline]
fn interpolate(&self, other: &Self, time: f64) -> Result<Self, ()> { fn interpolate(&self, other: &Self, time: f64) -> Result<Self, ()> {
Ok(CalcLengthOrPercentage { Ok(CalcLengthOrPercentage {
length: try!(self.length.interpolate(&other.length, time)), length: self.length.interpolate(&other.length, time).ok().and_then(|x|x),
percentage: try!(self.percentage.interpolate(&other.percentage, time)), percentage: self.percentage.interpolate(&other.percentage, time).ok().and_then(|x|x),
}) })
} }
} }