Skip to content

Commit fc3969b

Browse files
committed
fixed Fatal Exception: java.lang.IndexOutOfBoundsException
charAt: 122 >= length 0
1 parent 9f87398 commit fc3969b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib-n-ide/src/main/java/com/duy/ide/editor/view/GestureSupportEditor.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,15 @@ public boolean performLongClick() {
103103

104104
@Override
105105
public boolean onTouchEvent(MotionEvent ev) {
106-
if (!hasSelection() && mScaleDetector != null && mPreferences.isTouchScaleTextSize()) {
107-
mScaleDetector.onTouchEvent(ev);
108-
}
106+
try {
107+
if (!hasSelection() && mScaleDetector != null && mPreferences.isTouchScaleTextSize()) {
108+
mScaleDetector.onTouchEvent(ev);
109+
}
109110

110-
if (mGestureDetector != null) {
111-
mGestureDetector.onTouchEvent(ev);
111+
if (mGestureDetector != null) {
112+
mGestureDetector.onTouchEvent(ev);
113+
}
114+
} catch (Exception e) {
112115
}
113116
return super.onTouchEvent(ev);
114117
}
@@ -151,6 +154,7 @@ public void computeScroll() {
151154
super.computeScroll();
152155
}
153156
}
157+
154158
/**
155159
* @see GestureDetector.OnGestureListener#onFling(MotionEvent,
156160
* MotionEvent, float, float)

0 commit comments

Comments
 (0)