Fix NPE at boot.
This commit is contained in:
@@ -3711,6 +3711,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
// for each compound drawable in onDraw(). Make sure to update each section
|
// for each compound drawable in onDraw(). Make sure to update each section
|
||||||
// accordingly.
|
// accordingly.
|
||||||
final TextView.Drawables drawables = mDrawables;
|
final TextView.Drawables drawables = mDrawables;
|
||||||
|
if (drawables != null) {
|
||||||
if (drawable == drawables.mDrawableLeft) {
|
if (drawable == drawables.mDrawableLeft) {
|
||||||
final int compoundPaddingTop = getCompoundPaddingTop();
|
final int compoundPaddingTop = getCompoundPaddingTop();
|
||||||
final int compoundPaddingBottom = getCompoundPaddingBottom();
|
final int compoundPaddingBottom = getCompoundPaddingBottom();
|
||||||
@@ -3740,6 +3741,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
|
|||||||
scrollX += compoundPaddingLeft + (hspace - drawables.mDrawableWidthBottom) / 2;
|
scrollX += compoundPaddingLeft + (hspace - drawables.mDrawableWidthBottom) / 2;
|
||||||
scrollY += (mBottom - mTop - mPaddingBottom - drawables.mDrawableSizeBottom);
|
scrollY += (mBottom - mTop - mPaddingBottom - drawables.mDrawableSizeBottom);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
invalidate(dirty.left + scrollX, dirty.top + scrollY,
|
invalidate(dirty.left + scrollX, dirty.top + scrollY,
|
||||||
dirty.right + scrollX, dirty.bottom + scrollY);
|
dirty.right + scrollX, dirty.bottom + scrollY);
|
||||||
|
|||||||
Reference in New Issue
Block a user