wordpress-mobile / WordPress-Editor-Android

⛔️ [DEPRECATED] A reusable Android rich text editor component.
GNU General Public License v2.0
188 stars 50 forks source link

Crash report 5.5: StringIndexOutOfBoundsException in HtmlStyleUtils.applySpansByRegex #429

Closed maxme closed 8 years ago

maxme commented 8 years ago
Fatal Exception: java.lang.StringIndexOutOfBoundsException
       at android.text.SpannableStringBuilder.(SpannableStringBuilder.java)
       at android.text.SpannableStringBuilder.subSequence(SpannableStringBuilder.java:907)
       at org.wordpress.android.editor.HtmlStyleUtils.applySpansByRegex(HtmlStyleUtils.java:107)
       at org.wordpress.android.editor.HtmlStyleUtils.styleHtmlForDisplay(HtmlStyleUtils.java:87)
       at org.wordpress.android.editor.HtmlStyleTextWatcher.updateSpans(HtmlStyleTextWatcher.java:198)
       at org.wordpress.android.editor.HtmlStyleTextWatcher.afterTextChanged(HtmlStyleTextWatcher.java:92)
       at android.widget.TextView.sendAfterTextChanged(TextView.java:8928)
       at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:11255)
       at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:972)
       at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:499)
       at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:212)
       at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:30)
       at android.text.method.BaseKeyListener.deleteSelection(BaseKeyListener.java:109)
       at android.text.method.BaseKeyListener.backspaceOrForwardDelete(BaseKeyListener.java:73)
       at android.text.method.BaseKeyListener.backspace(BaseKeyListener.java:49)
       at android.text.method.BaseKeyListener.onKeyDown(BaseKeyListener.java:155)
       at android.text.method.QwertyKeyListener.onKeyDown(QwertyKeyListener.java:357)
       at android.text.method.TextKeyListener.onKeyDown(TextKeyListener.java:136)
       at android.widget.TextView.doKeyDown(TextView.java:6902)
       at android.widget.TextView.onKeyDown(TextView.java:6679)
       at android.view.KeyEvent.dispatch(KeyEvent.java:3173)
       at android.view.View.dispatchKeyEvent(View.java:7903)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:508)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.support.v4.view.ViewPager.dispatchKeyEvent(ViewPager.java:2652)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1470)
       at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2262)
       at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1612)
       at android.app.Activity.dispatchKeyEvent(Activity.java:2524)
       at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:534)
       at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
       at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
       at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2181)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4545)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4512)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4077)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4131)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4100)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4211)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4108)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4268)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4077)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4131)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4100)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4108)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4077)
       at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6433)
       at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6350)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6321)
       at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6286)
       at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3644)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5476)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
       at dalvik.system.NativeStart.main(NativeStart.java)