Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash upon cutting the last item of a bullet list #604

Closed
vchryssos opened this issue Oct 12, 2019 · 1 comment
Closed

Crash upon cutting the last item of a bullet list #604

vchryssos opened this issue Oct 12, 2019 · 1 comment

Comments

@vchryssos
Copy link

vchryssos commented Oct 12, 2019

Notes version: 1.0.0
Android version: 9.0

Reproduceability:

  • make a list of items, using "*" notation for each list item
  • select last item
  • cut
  • Notes crashes with following log

Log:
Version: 1.0.0

java.lang.IndexOutOfBoundsException: charAt: 469 >= length 469
	at android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java:123)
	at android.text.CharSequenceCharacterIterator.current(CharSequenceCharacterIterator.java:58)
	at android.text.CharSequenceCharacterIterator.setIndex(CharSequenceCharacterIterator.java:83)
	at android.icu.text.RuleBasedBreakIterator.CISetIndex32(RuleBasedBreakIterator.java:1126)
	at android.icu.text.RuleBasedBreakIterator.isBoundary(RuleBasedBreakIterator.java:503)
	at android.text.method.WordIterator.isBoundary(WordIterator.java:95)
	at android.widget.Editor$SelectionHandleView.positionAtCursorOffset(Editor.java:5467)
	at android.widget.Editor$HandleView.invalidate(Editor.java:4577)
	at android.widget.Editor$SelectionModifierCursorController.invalidateHandles(Editor.java:6145)
	at android.widget.Editor.invalidateHandlesAndActionMode(Editor.java:1985)
	at android.widget.TextView.spanChange(TextView.java:9926)
	at android.widget.TextView$ChangeWatcher.onSpanRemoved(TextView.java:12548)
	at android.text.SpannableStringBuilder.sendSpanRemoved(SpannableStringBuilder.java:1292)
	at android.text.SpannableStringBuilder.removeSpan(SpannableStringBuilder.java:500)
	at android.text.SpannableStringBuilder.removeSpan(SpannableStringBuilder.java:799)
	at android.text.SpannableStringBuilder.removeSpan(SpannableStringBuilder.java:787)
	at com.yydcdut.markdown.live.ListLive.updateListSpanBeginning(ListLive.java:641)
	at com.yydcdut.markdown.live.ListLive.onTextChanged(ListLive.java:149)
	at com.yydcdut.markdown.live.LivePrepare.onTextChanged(LivePrepare.java:81)
	at com.yydcdut.markdown.MarkdownEditText.onTextChanged4Controller(MarkdownEditText.java:252)
	at com.yydcdut.markdown.MarkdownEditText.access$700(MarkdownEditText.java:44)
	at com.yydcdut.markdown.MarkdownEditText$EditTextWatcher.onTextChanged(MarkdownEditText.java:176)
	at android.widget.TextView.sendOnTextChanged(TextView.java:9754)
	at android.widget.TextView.handleTextChanged(TextView.java:9851)
	at android.widget.TextView$ChangeWatcher.onTextChanged(TextView.java:12509)
	at android.text.SpannableStringBuilder.sendTextChanged(SpannableStringBuilder.java:1263)
	at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:575)
	at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:229)
	at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:36)
	at android.widget.TextView.deleteText_internal(TextView.java:12018)
	at android.widget.TextView.onTextContextMenuItem(TextView.java:11284)
	at android.widget.Editor$TextActionModeCallback.onActionItemClicked(Editor.java:4181)
	at com.android.internal.policy.DecorView$ActionModeCallback2Wrapper.onActionItemClicked(DecorView.java:2392)
	at com.android.internal.view.FloatingActionMode$3.onMenuItemSelected(FloatingActionMode.java:98)
	at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:776)
	at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:148)
	at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:923)
	at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:913)
	at com.android.internal.view.FloatingActionMode.lambda$setFloatingToolbar$0(FloatingActionMode.java:123)
	at com.android.internal.view.-$$Lambda$FloatingActionMode$LU5MpPuKYDtwlFAuYhXYfzgLNLE.onMenuItemClick(Unknown Source:2)
	at com.android.internal.widget.FloatingToolbar$FloatingToolbarPopup$2.onClick(FloatingToolbar.java:443)
	at android.view.View.performClick(View.java:6605)
	at android.view.View.performClickInternal(View.java:6582)
	at android.view.View.access$3100(View.java:778)
	at android.view.View$PerformClick.run(View.java:25897)
	at android.os.Handler.handleCallback(Handler.java:873)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:193)
	at android.app.ActivityThread.main(ActivityThread.java:6762)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
stefan-niedermann added a commit that referenced this issue Dec 16, 2019
stefan-niedermann added a commit that referenced this issue Dec 16, 2019
stefan-niedermann added a commit that referenced this issue Dec 20, 2019
* Workaround for #477 and #604

* Workaround for #477 and #604

* [tx-robot] updated from transifex

* [tx-robot] updated from transifex

* Bump butterknife from 10.2.0 to 10.2.1

Bumps [butterknife](https://github.com/JakeWharton/butterknife) from 10.2.0 to 10.2.1.
- [Release notes](https://github.com/JakeWharton/butterknife/releases)
- [Changelog](https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md)
- [Commits](JakeWharton/butterknife@10.2.0...10.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump butterknife-compiler from 10.2.0 to 10.2.1

Bumps [butterknife-compiler](https://github.com/JakeWharton/butterknife) from 10.2.0 to 10.2.1.
- [Release notes](https://github.com/JakeWharton/butterknife/releases)
- [Changelog](https://github.com/JakeWharton/butterknife/blob/master/CHANGELOG.md)
- [Commits](JakeWharton/butterknife@10.2.0...10.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: Nextcloud Bot <bot@nextcloud.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@stefan-niedermann
Copy link
Member

Please have a look at #622.

TL;DR: I think i might have found a workaround which prevents the actual crash, but a complete fix is not possible for us until we have found and implemented another markdown rendering library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants