[GrowTracker][v2.5.1] The app crashed when I canceled the photo-taking step.

Related Informations

Expected behavior

The users should be able to cancel the photo-taking step before adding a photo to plant details.

Actual behavior

When I tried to add a photo in a planted details and canceled the photo-taking step, then the app crashed.

How to reproduce

Here is every possible detail to reproduce the bug.

  1. Open the app.
  2. Add a new plant and save it.
  3. Open that created plant.
  4. Then go to the "Photo" tab and select "From camera" to add a photo in that plant details.
  5. The list of the camera apps would appear on your phone's screen.
  6. Don't click on anything, just press the back button of your phone and notice the crash.
  • App version: 2.5.1
  • Operating system: Android 6.0.1

Recording Of The Bug

bug

LogCat

06-26 23:41:44.812  6155  6155 E AndroidRuntime: FATAL EXCEPTION: main

06-26 23:41:44.812  6155  6155 E AndroidRuntime: Process: me.anon.grow, PID: 6155

06-26 23:41:44.812  6155  6155 E AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=android:fragment:1, request=1, result=0, data=null} to activity {me.anon.grow/me.anon.grow.PlantDetailsActivity}: java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.app.ActivityThread.deliverResults(ActivityThread.java:4998)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.app.ActivityThread.handleSendResult(ActivityThread.java:5041)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.app.ActivityThread.access$1600(ActivityThread.java:229)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1875)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7325)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

06-26 23:41:44.812  6155  6155 E AndroidRuntime: Caused by: java.lang.ArrayIndexOutOfBoundsException: length=12; index=-1

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at java.util.ArrayList.get(ArrayList.java:310)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at me.anon.grow.fragment.PlantDetailsFragment.onActivityResult(PlantDetailsFragment.java:445)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.app.Activity.dispatchActivityResult(Activity.java:7189)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    at android.app.ActivityThread.deliverResults(ActivityThread.java:4994)

06-26 23:41:44.812  6155  6155 E AndroidRuntime:    ... 9 more
H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center