[Qurany App][v2.5.1] The app crashed when I tried to do full/random test after submitting 0/zero as the start from ayah and end ayah

in #utopian-io5 years ago

Related Informations

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.
  • App version: 2.5.1
  • Operating system: Android 6.0.1

Recording Of The Bug

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)
Sort:  

Hi @sagorahmed, thanks for reporting this crash

The crash is not all that strange considering the input given. It is impossible to have a reading that starts and ends with zero. While an application should have catch blocks that prevents it crashing from wrong user inputs, you were expected to input any value other than zero

I see the PO has acknowledged the issue with a promise to come up with a fix. This is not really a major bug. An error prompt for when the field is empty or the value entered is 0 should temporarily fix this. This should be your expected behavior

Take note of this - "I expected the app not to crash" is not an expected behavior.

Thanks again fr the contribution. I look forward to reviewing more of your reports

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @fego! Keep up the good work!

Hi @sagorahmed!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @sagorahmed!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!