MahmoudMabrok / QuranyApp

Open Source HolyQuran app that provide Read, Listen, Tafseer, Test all of them and app is very small size.
Apache License 2.0
205 stars 52 forks source link

The app crashed when I tried to do full/random test after submitting 0/zero as the start from ayah and end ayah #48

Closed sagorahmed closed 5 months ago

sagorahmed commented 5 years ago

Expected behavior

I expected that the app wouldn't crash after submitting "0" as the "start from ayah and end at ayah" for a full/random test.

Actual behavior

When I clicked on full/random test after entering "0" as the "start from and end at ayah" digit, then the app crashed.

How to reproduce

Here is every possible detail to reproduce the bug.

  1. Open the app.
  2. Go to the "Test" tab.
  3. Give '0/zero' on the start from and end at ayah field.
  4. Press on "FULL TEST" or "RANDOM TEST" and notice the bug.

Recording Of The Bug

https://www.youtube.com/watch?v=4nMS16curCU

LogCat

07-02 01:05:18.238 23615 23615 E AndroidRuntime: FATAL EXCEPTION: main

07-02 01:05:18.238 23615 23615 E AndroidRuntime: Process: education.mahmoud.quranyapp, PID: 23615

07-02 01:05:18.238 23615 23615 E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'int education.mahmoud.quranyapp.data_layer.local.room.c.a' on a null object reference

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at education.mahmoud.quranyapp.feature.test_quran.TestFragment.a(Unknown Source)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at education.mahmoud.quranyapp.feature.test_quran.TestFragment.onbtnTestSaveRandom(Unknown Source)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at education.mahmoud.quranyapp.feature.test_quran.TestFragment_ViewBinding$2.a(Unknown Source)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at butterknife.a.a.onClick(Unknown Source)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at android.view.View.performClick(View.java:5714)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at android.widget.TextView.performClick(TextView.java:10932)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at android.view.View$PerformClick.run(View.java:22589)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:739)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:95)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7325)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

07-02 01:05:18.238 23615 23615 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
MahmoudMabrok commented 5 years ago

Thanks, I will work to solve it.

sagorahmed commented 5 years ago

Thank you so much for your feedback. Hopefully, you will fix this issue soon.

MahmoudMabrok commented 5 months ago

I will close issue now, when release a new version will share so we can check if crash exists or not.

thanks for your efforts.