android-client icon indicating copy to clipboard operation
android-client copied to clipboard

Add Client Submit crashes when you have no Internet connection

Open nirmalhk7 opened this issue 5 years ago • 3 comments

Summary: I face the following error when I try adding a client in offline mode. java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.List.isEmpty()' on a null object reference

Also note the weird looking dropdowns. Steps to reproduce:

  • Log in to the app.
  • Switch of your mobile data.
  • Try adding a client. You might see a loading spinner.
    • If you do: go back to the main Search fragment (Note that the Press back again to exit message appears when you go back from Add Client, which should'nt appear).
    • If you dont: you should see the Add Client screen with weird unusable dropdowns. Try submitting the client, which is when you get the NullPointerException.

Expected behaviour: The app doesnt allow anyone to log in without an active Internet connection (despite having an Offline mode, which I dont understand). However, if your internet drops after you log in, the expected behaviour is that wherever Internet connection is required, the app should notify the same. However, I'm able to add clients without an Internet connection.

Observed behaviour: Find the GIF attached below.

Device and Android version: Pixel 3 API 28 (Android Emulator)

Screenshots: untitled2

nirmalhk7 avatar Mar 20 '20 14:03 nirmalhk7

I am working on it.

Sachit1137 avatar Mar 24 '20 17:03 Sachit1137

I'm waiting for the mentors to give a green-flag to this issue, because it isn't a very big necessity.

I actually intended to work on it, but never mind. Let me know if you face any problems.

nirmalhk7 avatar Mar 25 '20 08:03 nirmalhk7

Oh..ok..sure

Sachit1137 avatar Mar 27 '20 07:03 Sachit1137