Fix for an NPE in TextView.

Change-Id: I0fca8f839cd444d9b70174078063efff5be499a3
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 28234bf..2f76bd0 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -6469,10 +6469,12 @@
             if (!mFrozenWithFocus || (selStart < 0 || selEnd < 0)) {
                 boolean selMoved = mSelectionMoved;
 
-                final int touchOffset = 
-                    ((SelectionModifierCursorController) mSelectionModifierCursorController).
-                    getMinTouchOffset();
-                Selection.setSelection((Spannable) mText, touchOffset);
+                if (mSelectionModifierCursorController != null) {
+                    final int touchOffset = 
+                        ((SelectionModifierCursorController) mSelectionModifierCursorController).
+                        getMinTouchOffset();
+                    Selection.setSelection((Spannable) mText, touchOffset);
+                }
 
                 if (mMovement != null) {
                     mMovement.onTakeFocus(this, (Spannable) mText, direction);