Esteem mobile v2.0.9; Using one of the markdown shortcuts, and using backspace after inputting the markdown syntax crashes the app.

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@harry-heightz·
0.000 HBD
Esteem mobile v2.0.9; Using one of the markdown shortcuts, and using backspace after inputting the markdown syntax crashes the app.
#### Project Information
* Repository: 
https://github.com/esteemapp/esteem-mobile
* Project Name: Eteem mobile
* Publisher : @good-karma

#### Expected behavior

I expected that after inputting the bullet point markdown tool, I could quickly erase it if I didn't need it anymore or, if I entered it by mistake. I expected the app would still function properly and I could still go ahead to use the post editor.

#### Actual Behavior

The app crashed after I used the bullet point markdown shortcut, and I deleted the entry immediately.

#### How to reproduce

- Enter the post editor.
- Click on the bullet point markdown shortcut
- Don't enter any other text after using the shortcut.
- Press backspace on your keyboard.
- See error. (The app crashes)

#### Test Environment

Device: Redmi Note 5 pro
OS: Android 8.1
Software version: Esteem mobile 2.0.9

#### Screen recording

https://youtu.be/5BpH6Og27Xs

#### Logcat

```  com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'selection' of a view managed by: AndroidTextInput
	at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:95)
	at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:132)
	at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:51)
	at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:32)
	at com.facebook.react.uimanager.NativeViewHierarchyManager.updateProperties(NativeViewHierarchyManager.java:138)
	at com.facebook.react.uimanager.UIViewOperationQueue$UpdatePropertiesOperation.execute(UIViewOperationQueue.java:95)
	at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:894)
	at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1001)
	at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:46)
	at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1061)
	at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
	at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:134)
	at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:105)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1024)
	at android.view.Choreographer.doCallbacks(Choreographer.java:838)
	at android.view.Choreographer.doFrame(Choreographer.java:766)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1012)
	at android.os.Handler.handleCallback(Handler.java:790)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:171)
	at android.app.ActivityThread.main(ActivityThread.java:6635)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Native Method)
	at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:83)
	... 23 more
Caused by: java.lang.IndexOutOfBoundsException: setSpan (3 ... 3) ends beyond length 2
	at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1309)
	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:680)
	at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:672)
	at android.text.Selection.setSelection(Selection.java:76)
	at android.widget.EditText.setSelection(EditText.java:120)
	at com.facebook.react.views.textinput.ReactEditText.setSelection(ReactEditText.java:250)
	at com.facebook.react.views.textinput.ReactTextInputManager.setSelection(ReactTextInputManager.java:278)
	... 25 more
```

#### GitHub Account
https://github.com/HarryHeights


Link to [issue](https://github.com/esteemapp/esteem-mobile/issues/690)
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,