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

java.lang.IndexOutOfBoundsException (History.doHandleHistory) #894

Open
ercanduman opened this issue Feb 14, 2020 · 2 comments
Open

java.lang.IndexOutOfBoundsException (History.doHandleHistory) #894

ercanduman opened this issue Feb 14, 2020 · 2 comments

Comments

@ercanduman
Copy link

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
Copy link
Author

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)
        }

@hypest
Copy link
Contributor

hypest commented Feb 14, 2020

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

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

No branches or pull requests

2 participants