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

Commit 59993d9b authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Android (Google) Code Review
Browse files

Merge "Avoid NPE in WebTextView.lineUpScroll -> Touch.getMaxScrollX" into gingerbread

parents bdf1706a 44d2c69a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.text.Editable;
import android.text.InputFilter;
import android.text.Layout;
import android.text.Selection;
import android.text.Spannable;
import android.text.TextPaint;
@@ -292,8 +293,9 @@ import java.util.ArrayList;
     * Ensure that the underlying textfield is lined up with the WebTextView.
     */
    private void lineUpScroll() {
        if (mWebView != null) {
            float maxScrollX = Touch.getMaxScrollX(this, getLayout(), mScrollY);
        Layout layout = getLayout();
        if (mWebView != null && layout != null) {
            float maxScrollX = Touch.getMaxScrollX(this, layout, mScrollY);
            if (DebugFlags.WEB_TEXT_VIEW) {
                Log.v(LOGTAG, "onTouchEvent x=" + mScrollX + " y="
                        + mScrollY + " maxX=" + maxScrollX);