Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83fa41b0 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Fix TextView potential NPE in isLayoutRtl()

- test if mDrawables can be null
- see bug #4517017 (was seen with Monkeys)

Change-Id: I07f04c88a238d1cae6fe89b0ab56fc2c456b8534
parent 6e10b08b
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -4144,11 +4144,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    @Override
    public boolean isLayoutRtl(Drawable who) {
        if (who == null) return false;
        final TextView.Drawables drawables = mDrawables;
        if (mDrawables != null) {
            final Drawables drawables = mDrawables;
            if (who == drawables.mDrawableLeft || who == drawables.mDrawableRight ||
                who == drawables.mDrawableTop || who == drawables.mDrawableBottom) {
                return isLayoutRtl();
            }
        }
        return super.isLayoutRtl(who);
    }