Add Client Submit crashes when you have no Internet connection
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 exitmessage 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.
- If you do: go back to the main Search fragment (Note that the
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:

I am working on it.
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.
Oh..ok..sure