From dfef456f183713da8c05fe5f3d252736a7776c8c Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Thu, 1 Nov 2012 12:15:12 +0000 Subject: [PATCH] Fix asserts in SkPathMeasure to honor documented API Review URL: https://codereview.appspot.com/6822061 git-svn-id: http://skia.googlecode.com/svn/trunk@6232 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkPathMeasure.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp index 8b1ec2d7f8..436753e4a1 100644 --- a/src/core/SkPathMeasure.cpp +++ b/src/core/SkPathMeasure.cpp @@ -418,8 +418,7 @@ const SkPathMeasure::Segment* SkPathMeasure::distanceToSegment( bool SkPathMeasure::getPosTan(SkScalar distance, SkPoint* pos, SkVector* tangent) { - SkASSERT(fPath); - if (fPath == NULL) { + if (NULL == fPath) { return false; } @@ -446,6 +445,10 @@ bool SkPathMeasure::getPosTan(SkScalar distance, SkPoint* pos, bool SkPathMeasure::getMatrix(SkScalar distance, SkMatrix* matrix, MatrixFlags flags) { + if (NULL == fPath) { + return false; + } + SkPoint position; SkVector tangent;