title: Firebase AuthStateListener throwing NullPointerException
body: <p>I keep getting this weird error and I can't for the life of me figure out what it is.</p>
  
  <blockquote>
    <p>java.lang.NullPointerException: Attempt to invoke interface method
    'void
    com.google.firebase.auth.FirebaseAuth$AuthStateListener.onAuthStateChanged(com.google.firebase.auth.FirebaseAuth)'
    on a null object reference
                                                                                   at com.google.firebase.auth.FirebaseAuth$1.run(Unknown Source)</p>
  </blockquote>
  
  <pre><code>package com.workoutwager.headshot;
  
  import android.content.Intent;
  import android.support.annotation.NonNull;
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  import android.widget.Button;
  import android.widget.EditText;
  import android.widget.TextView;
  
  import com.google.firebase.FirebaseApp;
  import com.google.firebase.auth.FirebaseAuth;
   import com.google.firebase.auth.FirebaseUser;
  
  public class MainActivity extends AppCompatActivity {
  
  private Button mSignUpBtn;
  private EditText mEmailEdit;
  private EditText mPasswordEdit;
  private FirebaseAuth mAuth;
  private FirebaseAuth.AuthStateListener mAuthState;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      FirebaseApp.initializeApp(this);
      setContentView(R.layout.activity_main);
      mSignUpBtn = (Button) findViewById(R.id.signUpBtn);
      mEmailEdit = (EditText) findViewById(R.id.emailEditText);
      mPasswordEdit = (EditText)findViewById(R.id.passwordEditText);
      mAuth = FirebaseAuth.getInstance();
      mAuthState = new FirebaseAuth.AuthStateListener() {
          @Override
          public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
              if (firebaseAuth.getCurrentUser()!=null){
                  //Not signed in
                  Intent loginIntent = new Intent (MainActivity.this, LoginActivity.class);
                  loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  startActivity(loginIntent);
              }
              else {
                  startActivity(new Intent(MainActivity.this, LoginActivity.class));
              }
          }
      };
  
  
      }
  @Override
  public void onStart(){
      super.onStart();
      mAuth.addAuthStateListener(mAuthState);
  }
  }
  </code></pre>