Permalink
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 918c8e8 commit 5f9666dedb52017004ca59f7fe347e3517a517c2 @dougt dougt committed Jan 31, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 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 5f9666d

Please sign in to comment.