title: TypeError: Cannot read property 'uid' of null
body: <p>I am trying to log in with a phone number in my app with firebase but I am facing issue with the login process. I'm not able to login with a phone number in firebase but if I register with a phone number and redirect to the homepage it's working properly. I am using the same method to login, but I got the issue like <code>TypeError: Cannot read property 'uid' of null</code> but I an successfully getting all the console values. I don't know what is being the issue here. But that error is displaying in 3 times repeatedly,</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    renderLoginButton() {
          if (this.props.loading) {
            return (
              &lt;Spinner size="large" /&gt;
            );
          }
  
          return (
            &lt;Button
            style={{ alignSelf: 'flex-start' }}
              onPress={this.onLoginBtnClicked.bind(this)}
            &gt;
              Login
            &lt;/Button&gt;
          );
        }
  </code></pre>
  
  <p>onLoginBtnClicked() {</p>
  
  <pre><code>    const { contact, password } = this.props;
      const error =  Validator('password', password) ||  Validator('contact', contact);
  
      if (error !== null) {
        Alert.alert(error);
      } else {
            console.log('else');
          // this.props.loginUser({ contact, password});
  
          const mobileNo = '+91'+contact;
          firebase.auth().signInWithPhoneNumber(mobileNo)
          .then(confirmResult =&gt;
              console.log(confirmResult),
              curr = firebase.auth(),
              console.log("curr"+JSON.stringify(curr)),
              this.setState({ data: curr}),
              NavigationService.navigate('Home')
          )
          .catch(error =&gt; console(error.message) );
      }
  
  }
  </code></pre>
  
  <p>CustomDrawerComponent.js</p>
  
  <pre><code>    import React, { Component } from 'react';
  import { View, Image, Text } from 'react-native';
  import { DrawerItems } from 'react-navigation';
  import { connect } from 'react-redux';
  
  import { fetchUserDetails } from '../actions';
  
  class CustomDrawerContentComponent extends Component {
  
    state = {
      uri: '',
      isfailed: ''
    }
  
    componentWillMount() {
      this.props.fetchUserDetails();
    }
  
    componentWillReceiveProps(nextProps) {
      let uri = '';
      if (nextProps.ProfilePic !== '') {
        uri = nextProps.ProfilePic;
        this.setState({ uri, isfailed: false });
      } else {
        uri = '../images/ic_person_24px.png';
        this.setState({ uri, isfailed: true });
      }
  
      this.setState({ uri });
    }
  
    renderProfileImage() {
      if (!this.state.isfailed) {
        return (
          &lt;Image
            style={styles.profileImageStyle}
            source={{ uri: (this.state.uri) }}
          /&gt;
        );
      }
      return (
        &lt;Image
          style={styles.profileImageStyle}
          source={require('../images/ic_person_24px.png')}
        /&gt;
      );
    }
  
    render() {
      console.log('Profile Pic :: ', this.props.ProfilePic);
      return (
        &lt;View style={styles.container}&gt;
          {this.renderProfileImage()}
          &lt;Text style={styles.textStyle}&gt;
            {this.props.name} - {this.props.category}
          &lt;/Text&gt;
          &lt;DrawerItems {...this.props} /&gt;
        &lt;/View&gt;
      );
    }
  }
  
  const styles = {
    container: {
      flex: 1,
      paddingLeft: 10
    },
    textStyle: {
      fontSize: 14,
      textAlign: 'left',
      color: '#000000'
    },
    profileImageStyle: {
      alignSelf: 'flex-start',
      marginTop: 16,
      padding: 10,
      width: 40,
      height: 40,
      borderRadius: 75
    }
  };
  
  const mapStateToProps = state =&gt; {
    const { userprofile } = state;
    return userprofile;
  };
  
  export default connect(mapStateToProps, { fetchUserDetails })(CustomDrawerContentComponent);
  </code></pre>
  
  <p>callStack:</p>
  
  <p><a href="https://i.stack.imgur.com/gJdnL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gJdnL.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/Be0pS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Be0pS.png" alt="enter image description here"></a></p>