AztecEditor-Android icon indicating copy to clipboard operation
AztecEditor-Android copied to clipboard

java.lang.IndexOutOfBoundsException (History.doHandleHistory)

Open ercanduman opened this issue 5 years ago • 2 comments

Fatal Exception: java.lang.IndexOutOfBoundsException Index: 2, Size: 0 org.wordpress.aztec.History.doHandleHistory

java.util.LinkedList.checkElementIndex (LinkedList.java:555) java.util.LinkedList.remove (LinkedList.java:525) org.wordpress.aztec.History.doHandleHistory (History.kt:65) org.wordpress.aztec.History$HistoryRunnable.run (History.kt:199) android.os.Handler.handleCallback (Handler.java:790) android.os.Handler.dispatchMessage (Handler.java:99) android.os.Looper.loop (Looper.java:198) android.app.ActivityThread.main (ActivityThread.java:7055) java.lang.reflect.Method.invoke (Method.java) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:523) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:836)

Tested

Device Brand: OPPO Model: A7 Orientation: Portrait RAM free: 1.36 GB Disk free: 33.19 GB Operating System Version: 8.1.0 Orientation: Portrait Rooted: No Crash Date: 14 Feb 2020, 04:43:00

ercanduman avatar Feb 14 '20 09:02 ercanduman

I found the line and it has something like:

        while (historyCursor != historyList.size && historyCursor >= 0) {
            historyList.removeAt(historyCursor)
        }

Is it going to solve the problem If I changed to as below?

        while (historyCursor != historyList.size && historyCursor >= 0) {
            if (historyList.size > 0 && historyList.size > historyCursor) historyList.removeAt(historyCursor)
        }

ercanduman avatar Feb 14 '20 09:02 ercanduman

👋 @ercanduman , thanks for reporting! Do you happen to have steps to reproduce the crash?

hypest avatar Feb 14 '20 11:02 hypest