lordi / tickmate

One bit journal
GNU General Public License v3.0
111 stars 35 forks source link

Can't add any track - CursorIndexOutOfBoundsException #38

Closed ghost closed 9 years ago

ghost commented 9 years ago

Steps to reproduce:

As a result, a dialog box with this message appears:

Unfortunately, Tickmate has stopped.

Stacktrace:

D/tickmate(20311): Opening database
D/AndroidRuntime(20311): Shutting down VM
W/dalvikvm(20311): threadid=1: thread exiting with uncaught exception (group=0x415fcce0)
E/AndroidRuntime(20311): FATAL EXCEPTION: main
E/AndroidRuntime(20311): Process: de.smasi.tickmate, PID: 20311
E/AndroidRuntime(20311): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {de.smasi.tickmate/de.smasi.tickmate.views.EditTracksActivity}: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
E/AndroidRuntime(20311):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3389)
E/AndroidRuntime(20311):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3432)
E/AndroidRuntime(20311):    at android.app.ActivityThread.access$1300(ActivityThread.java:144)
E/AndroidRuntime(20311):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1253)
E/AndroidRuntime(20311):    at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(20311):    at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(20311):    at android.app.ActivityThread.main(ActivityThread.java:5146)
E/AndroidRuntime(20311):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(20311):    at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(20311):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
E/AndroidRuntime(20311):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
E/AndroidRuntime(20311):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(20311): Caused by: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
E/AndroidRuntime(20311):    at android.database.AbstractCursor.checkPosition(AbstractCursor.java:426)
E/AndroidRuntime(20311):    at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
E/AndroidRuntime(20311):    at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
E/AndroidRuntime(20311):    at de.smasi.tickmate.database.TracksDataSource.cursorToTrack(TracksDataSource.java:273)
E/AndroidRuntime(20311):    at de.smasi.tickmate.database.TracksDataSource.getTrack(TracksDataSource.java:88)
E/AndroidRuntime(20311):    at de.smasi.tickmate.views.EditTracksActivity.onActivityResult(EditTracksActivity.java:106)
E/AndroidRuntime(20311):    at android.app.Activity.dispatchActivityResult(Activity.java:5423)
E/AndroidRuntime(20311):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3385)
E/AndroidRuntime(20311):    ... 11 more
W/ActivityManager(  727):   Force finishing activity de.smasi.tickmate/.views.EditTracksActivity

I have Tickmate 1.2.0, installed from F-Droid, on Android 4.4.4 (CyanogenMod 11).

Let me know if you need more details, or if I can help.

jkms commented 9 years ago

Same issue. TickMate 1.2.0, F-Droid, AOSP.

lordi commented 9 years ago

Thanks for the complete report. I'll fix the issue later the day.

lordi commented 9 years ago

Fixed with ed127c37bf70590374ce3053cd0728120439a723, please try 1.2.1

ghost commented 9 years ago

It works now, thank you!

jkms commented 9 years ago

Perfect, thanks!