mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-28 13:38:10 +08:00
fix(android): drawPath CRASH_java.lang.NullPointerException
This commit is contained in:
+6
-10
@@ -423,7 +423,7 @@ public class BackgroundDrawable extends BaseDrawable
|
||||
{
|
||||
// updateStyle border with radius path
|
||||
updatePath();
|
||||
|
||||
assert mPathForBorderRadius != null;
|
||||
// draw bg color
|
||||
boolean useGradientPaint = initGradientPaint();
|
||||
if (useGradientPaint) {
|
||||
@@ -801,19 +801,15 @@ public class BackgroundDrawable extends BaseDrawable
|
||||
|
||||
private void updatePath()
|
||||
{
|
||||
if (!mNeedUpdateBorderPath)
|
||||
{
|
||||
return;
|
||||
}
|
||||
mNeedUpdateBorderPath = false;
|
||||
if (mPathForBorderRadius == null)
|
||||
{
|
||||
if (mPathForBorderRadius == null) {
|
||||
mPathForBorderRadius = new Path();
|
||||
mTempRectForBorderRadius = new RectF();
|
||||
}
|
||||
|
||||
if (!mNeedUpdateBorderPath) {
|
||||
return;
|
||||
}
|
||||
mNeedUpdateBorderPath = false;
|
||||
mPathForBorderRadius.reset();
|
||||
|
||||
mTempRectForBorderRadius.set(mRect);
|
||||
float fullBorderWidth = mBorderWidthArray == null ? 0 : mBorderWidthArray[0];
|
||||
if (fullBorderWidth > 1)
|
||||
|
||||
Reference in New Issue
Block a user