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

Commit df4ee430 authored by Gilles Debunne's avatar Gilles Debunne
Browse files

Fix for NPE in TextView.

Bug http://b/issue?id=2941549

Change-Id: Id5cbf0a3b2b68f450a9271333b96d41b01aa9f5c
parent 8395b462
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -7117,6 +7117,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        int selectionStart, selectionEnd;

        // selectionModifierCursorController is not null at that point
        SelectionModifierCursorController selectionModifierCursorController =
            ((SelectionModifierCursorController) mSelectionModifierCursorController);
        int minOffset = selectionModifierCursorController.getMinTouchOffset();
@@ -7140,6 +7141,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }
    
    private String getWordForDictionary() {
        if (mSelectionModifierCursorController == null) {
            return null;
        }

        int offset = ((SelectionModifierCursorController) mSelectionModifierCursorController).
                     getMinTouchOffset();