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

Commit b9b77aec authored by Victoria Lease's avatar Victoria Lease
Browse files

no layout = no visibility

This fixes an Editor crash when the associated TextView's Layout
is null.

Bug: 11165608
Change-Id: I061c0db6eef95bf39a7696ad6e6f919bd22bfb11
parent d38b1302
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -800,6 +800,8 @@ public class Editor {

    private boolean isOffsetVisible(int offset) {
        Layout layout = mTextView.getLayout();
        if (layout == null) return false;

        final int line = layout.getLineForOffset(offset);
        final int lineBottom = layout.getLineBottom(line);
        final int primaryHorizontal = (int) layout.getPrimaryHorizontal(offset);