summaryrefslogtreecommitdiff
path: root/core/java/android
diff options
context:
space:
mode:
authorGilles Debunne <debunne@google.com>2011-08-25 13:45:11 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-08-25 13:45:11 -0700
commit8e7e95f22f700fae6926d87b25c388bf9b509389 (patch)
tree2c2d286f84084bd1e0eec1004a8903ca98d8110c /core/java/android
parent463854bead24c951932d1d8c31e4f22cbce983fb (diff)
parentfd419b051a43c68b28131d1fd4535af0d21b5039 (diff)
Merge "Bug 5166707: NPE fixed in getFocusedRect"
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/widget/TextView.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 2b94417aefc9..c92b5f9f5bb3 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -4788,8 +4788,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
selEnd = getSelectionEnd();
if (selStart >= 0) {
- if (mHighlightPath == null)
- mHighlightPath = new Path();
+ if (mHighlightPath == null) mHighlightPath = new Path();
if (selStart == selEnd) {
if (isCursorVisible() &&
@@ -4995,6 +4994,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
} else {
// Selection extends across multiple lines -- the focused
// rect covers the entire width.
+ if (mHighlightPath == null) mHighlightPath = new Path();
if (mHighlightPathBogus) {
mHighlightPath.reset();
mLayout.getSelectionPath(selStart, selEnd, mHighlightPath);