From f9a8fe0afef5b4a6bac6071b812a4faac0f963b7 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 1 Jul 2016 21:02:28 -0700 Subject: [PATCH] Do not crash on partial calc interpolation Fixes #12151 Fixes regression introduced by #11924 --- .../style/properties/helpers/animated_properties.mako.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 552f5b303c3..ad34f59dc89 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -329,8 +329,8 @@ impl Interpolate for CalcLengthOrPercentage { #[inline] fn interpolate(&self, other: &Self, time: f64) -> Result { Ok(CalcLengthOrPercentage { - length: try!(self.length.interpolate(&other.length, time)), - percentage: try!(self.percentage.interpolate(&other.percentage, time)), + length: self.length.interpolate(&other.length, time).ok().and_then(|x|x), + percentage: self.percentage.interpolate(&other.percentage, time).ok().and_then(|x|x), }) } }