Repository: incubator-weex Updated Branches: refs/heads/master 627f653a8 -> 1feea4c19
* [iOS] add protection for iOS 8 crash about the bezierPath crash in nan or illegal input Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/1feea4c1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/1feea4c1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/1feea4c1 Branch: refs/heads/master Commit: 1feea4c19a58e75f778ce3f0d70643795f8ff8ae Parents: 627f653 Author: acton393 <zhangxing610...@gmail.com> Authored: Tue Apr 24 12:02:07 2018 +0800 Committer: acton393 <zhangxing610...@gmail.com> Committed: Tue Apr 24 12:02:07 2018 +0800 ---------------------------------------------------------------------- ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1feea4c1/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m ---------------------------------------------------------------------- diff --git a/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m b/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m index f13c8b0..b7aa821 100644 --- a/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m +++ b/ios/sdk/WeexSDK/Sources/Display/UIBezierPath+Weex.m @@ -37,7 +37,11 @@ static const float kCircleControlPoint = 0.447715; // +------------------+ // \\ top // // \\+----------+// - [path addLineToPoint:CGPointMake(CGRectGetMaxX(rect) - topRightRadius, rect.origin.y)]; + CGPoint topRightPoint = CGPointMake(CGRectGetMaxX(rect) - topRightRadius, rect.origin.y); + if (isnan(topRightPoint.x) || isnan(topRightPoint.y)) { + return path; + } + [path addLineToPoint:topRightPoint]; if (topRightRadius > 0) { [path addCurveToPoint:CGPointMake(CGRectGetMaxX(rect), rect.origin.y + topRightRadius) controlPoint1:CGPointMake(CGRectGetMaxX(rect) - topRightRadius * kCircleControlPoint, rect.origin.y)