infiniteoverflow / Libro

An App Built using flutter using which we can share books with people around us !!
54 stars 50 forks source link

The method 'substring' was called on null. Error coming in drawer. #132

Closed SapinderSingh closed 3 years ago

SapinderSingh commented 3 years ago

Describe the bug If user don't logs in using google, we don't have user's name, but we have to display something on the drawer, if we don't have user's name.

To Reproduce Steps to reproduce the behavior:

  1. Login to app using email and password.
  2. Click on drawer icon in the top left.
  3. See error

Expected behavior Either there should be user displayed displayed, or something like, 'nothing' should be displayed, rather than an error.

Screenshot

2121

infiniteoverflow commented 3 years ago

I will just check and get back to u on this.

infiniteoverflow commented 3 years ago

I am not facing this error in my device. Can you please pull the new changes and check again.

SapinderSingh commented 3 years ago

@infiniteoverflow Please watch this video. https://user-images.githubusercontent.com/29424616/118956257-120fad80-b97d-11eb-9bde-4422538301a4.mp4

Note that this error will only come if you sign in using email and password, it will not come, if you login using google.

EAsmithaShrree commented 3 years ago

Heyy so I coded this part of the program. I think you will receive this error if you had signed up to the app before I added the code for asking for the username during signup. Because before I added that part of the code, everybody who signed up would have done so without giving their username so that will be null for all the old users.

Does this make sense? I am guessing that this is the problem.

SapinderSingh commented 3 years ago

@EAsmithaShrree Yes, you are right. Closing the issue.