title: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference at
body: <pre><code> This is the errror, tried a few things but still to no avail.
  </code></pre>
  
  <p><strong>java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object referenc</strong>e                                                                        at com.dllibrary.cart.SigninMainActivity$1$1.onDataChange(<strong><em>SigninMainActivity.java:56)</em></strong>
                                                                          at com.google.android.gms.internal.zzegf.zza(Unknown Source)
                                                                          at com.google.android.gms.internal.zzeia.zzbyc(Unknown Source)
                                                                          at com.google.android.gms.internal.zzeig.run(Unknown Source)
                                                                          at android.os.Handler.handleCallback(Handler.java:815)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:104)
                                                                          at android.os.Looper.loop(Looper.java:194)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5637)
                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                          at java.lang.reflect.Method.invoke(Method.java:372)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)</p>
  
  <p><strong>code for my sign in method</strong></p>
  
  <pre><code>     signin.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
  
             final ProgressDialog mdialog = new       ProgressDialog(SigninMainActivity.this);
              mdialog.setMessage("Please waiting");
              mdialog.show();
              table_user.addValueEventListener(new ValueEventListener() {
                  @Override
                  public void onDataChange(DataSnapshot dataSnapshot) {
                      //check if user not exist
                      if (dataSnapshot.child(phone.getText().toString()).exists()) {
                          //Get User Information
                          mdialog.dismiss();
  
                          User user = dataSnapshot.child(phone.getText().toString()).getValue(User.class);
                         if (user.getPassword().equals(password.getText().toString())) {
                              Intent homeIntent= new Intent(SigninMainActivity.this, home.class);
                              Common.currentUser = user;
                              startActivity(homeIntent);
                              finish();
                          } else {
  
                              Toast.makeText(SigninMainActivity.this, "Sign in failed", Toast.LENGTH_SHORT).show();
  
  
                          }
                      }else{
                          mdialog.dismiss();
                          Toast.makeText(SigninMainActivity.this, "User Does Not exist", Toast.LENGTH_SHORT).show();
                      }
                  }
  </code></pre>
  
  <p><strong>line 56 is at "if(user.getPassword.equals)"</strong></p>