summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2010-08-25 19:13:48 -0700
committerGilles Debunne <debunne@google.com>2010-08-25 19:15:10 -0700
commitdf4ee43062281ee9cf908a7c45b269738bd017d3 (patch)
tree998461b5f4ba5c818ec94857deca10c9210b6c3f
parent8395b4625b96f2133e2e4f595fdc69fbe222e4fc (diff)
downloadframeworks_base-df4ee43062281ee9cf908a7c45b269738bd017d3.zip
frameworks_base-df4ee43062281ee9cf908a7c45b269738bd017d3.tar.gz
frameworks_base-df4ee43062281ee9cf908a7c45b269738bd017d3.tar.bz2
Fix for NPE in TextView.
Bug http://b/issue?id=2941549 Change-Id: Id5cbf0a3b2b68f450a9271333b96d41b01aa9f5c
-rw-r--r--core/java/android/widget/TextView.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 2f76bd0..8ab8f9d 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -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();