stepstone-tech / android-material-stepper

This library allows to use Material steppers inside Android applications.
Apache License 2.0
1.78k stars 263 forks source link

Crash in StepperLayout.findCurrentStep #261

Open Hannibal-pl opened 6 years ago

Hannibal-pl commented 6 years ago

Firebase report to me crash in stepper. In stacktrace there are no my methods so I don't know crash context. Affected device was Samsung SM-G903F (S5 Neo?) running Android 6.0.1.

Stack trace: Exception java.lang.NullPointerException: Attempt to invoke interface method 'com.stepstone.stepper.Step com.stepstone.stepper.adapter.StepAdapter.findStep(int)' on a null object reference

com.stepstone.stepper.StepperLayout.findCurrentStep (StepperLayout.java:937)
com.stepstone.stepper.StepperLayout.onBackClicked (StepperLayout.java:409)
com.stepstone.stepper.StepperLayout$OnBackClickListener.onClick (StepperLayout.java:178)
android.view.View.performClick (View.java:5698)
android.widget.TextView.performClick (TextView.java:10846)
android.view.View$PerformClick.run (View.java:22565)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:158)
android.app.ActivityThread.main (ActivityThread.java:7230)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
zawadz88 commented 6 years ago

Hi, Thanks for raising this. Do you see a lot of crashes like this?

Hannibal-pl commented 6 years ago

My app isn't very popular jet so hart to tell how often it appears. But I just get second one with very similar trace (Samsung SM-J530F (J5 2017) @ Android 7.0):

com.stepstone.stepper.StepperLayout.findCurrentStep (StepperLayout.java:937)
com.stepstone.stepper.StepperLayout.onNext (StepperLayout.java:946)
com.stepstone.stepper.StepperLayout.access$700 (StepperLayout.java:70)
com.stepstone.stepper.StepperLayout$OnNextClickListener.onClick (StepperLayout.java:185)
android.view.View.performClick (View.java:6261)
android.widget.TextView.performClick (TextView.java:11159)
android.view.View$PerformClick.run (View.java:23752)
android.os.Handler.handleCallback (Handler.java:751)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:154)
android.app.ActivityThread.main (ActivityThread.java:6776)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1496)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1386)