[GrowTracker][v2.5.1] The app crashed when I clicked on settings after deleting my selected default garden in the settings.

in #utopian-io5 years ago

Project Information

Expected behavior

I expected that I could click on settings after deleting a garden, which was chosen for the default garden in the app settings before.

Actual behavior

After creating a garden and selecting it as the default garden of the app. When I tried open the settings after deleting that garden, then the app crashed.
It crashes every time after that crash and I am not able to use it.

How to reproduce

Here is every possible detail to reproduce the bug.

  1. Open the app.
  2. Create a new garden.
  3. Go to the settings and select it as your default garden.
  4. After that delete the garden you created and selected in the settings before.
  5. At last, try to go in the settings and notice the crash.
    You can't use the app after this crash. It would crash every time when you try to use the app.
  • App version: 2.5.1
  • Operating system: Android 6.0.1

Recording Of The Bug

Watch the bug on Youtube..

LogCat

06-27 12:30:55.182  2079  2079 E AndroidRuntime: FATAL EXCEPTION: main

06-27 12:30:55.182  2079  2079 E AndroidRuntime: Process: me.anon.grow, PID: 2079

06-27 12:30:55.182  2079  2079 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{me.anon.grow/me.anon.grow.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.MenuItem.setChecked(boolean)' on a null object reference

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.ActivityThread.access$1100(ActivityThread.java:229)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7325)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

06-27 12:30:55.182  2079  2079 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'android.view.MenuItem android.view.MenuItem.setChecked(boolean)' on a null object reference

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at me.anon.grow.MainActivity.onCreate(MainActivity.java:86)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:6904)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)

06-27 12:30:55.182  2079  2079 E AndroidRuntime:    ... 9 more
Sort:  

Hello, @sagorahmed. Thank you for your contribution. You have done a nice job with your report. Good to see that the PO implemented a fix immediately. Bravo!

The logs also were very helpful I believe. Well done providing a log.

I look forward to your next contribution.

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, @knowledges! 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!