Merge "Fix for NPE in TextView." into gingerbread

This commit is contained in:
Gilles Debunne
2010-08-26 10:58:58 -07:00
committed by Android (Google) Code Review

View File

@@ -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();