Browse files

Bug 720092 - java.lang.IndexOutOfBoundsException: getChars (0 ... 881…

…68) ends beyond length 0. We do not know why this is happening yet. This patch catches the throw and logs what values we have for start and end. r=alexp
  • Loading branch information...
1 parent 7da3496 commit ecc3d5e4cf96b16b7c1d575be5eb39b012c2c1c5 @dougt dougt committed Jan 31, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 mobile/android/base/GeckoInputConnection.java
View
10 mobile/android/base/GeckoInputConnection.java
@@ -206,8 +206,16 @@ public ExtractedText getExtractedText(ExtractedTextRequest req, int flags) {
extract.selectionEnd = b;
extract.startOffset = 0;
- extract.text = content.toString();
+ try {
+ extract.text = content.toString();
+ } catch (IndexOutOfBoundsException iob) {
+ Log.d(LOGTAG,
+ "IndexOutOfBoundsException thrown from getExtractedText(). start: " +
+ Selection.getSelectionStart(content) +
+ " end: " + Selection.getSelectionEnd(content));
+ return null;
+ }
return extract;
}

0 comments on commit ecc3d5e

Please sign in to comment.