Home > Enterprise >  What does this error "null is not an object "mean? And what should I do?
What does this error "null is not an object "mean? And what should I do?

Time:11-24

I am getting this error whenrunning on expo. The uid is in firebase.

enter image description here

CodePudding user response:

You are probably trying to access the property "uid" of the object user before it is set.

The error says exactly that, that you are trying to get the property uid of a null object.

Make sure the object is set before you try to access it

CodePudding user response:

You could not access uid because the value of the user is null. You should use user?.uid for the null safe operator. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining

  • Related