title: Value of a child in firebase database showing null
body: <p>i usually work with firebase database like a constant 'Name' and a variable 'Value' but now according to my new project im trying to make both of it as variables which means that both aren't decided by me but the user... like this - <a href="https://ibb.co/cGh3qJ" rel="nofollow noreferrer">https://ibb.co/cGh3qJ</a></p>
  
  <p>My error - <a href="https://ibb.co/hiJ4xy" rel="nofollow noreferrer">https://ibb.co/hiJ4xy</a> </p>
  
  <p>Code</p>
  
  <p>Fetching Data</p>
  
  <pre><code>Results results;
  String Name, Score;
  private void fetchResults() {
      mDatabaseReference.child("Users").child(id).child("Quiz").child("Results").child(id).addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              for (DataSnapshot childDataSnapshot : dataSnapshot.getChildren()) {
                  Name = childDataSnapshot.getKey().toString();
                  Score = String.valueOf(childDataSnapshot.child(Name).getValue(Results.class));
                  results = new Results(Name, Score);
                  resultsList.add(results);
                  mAdapter.notifyDataSetChanged();
              }
              mAdapter.notifyDataSetChanged();
  
                      }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
              throw databaseError.toException();
          }
      });
  }
  </code></pre>
  
  <p>Class</p>
  
  <pre><code>public class Results {
  private String Name;
  private String Score;
  
  public Results() {
  }
  
  public Results(String Name, String Score) {
      this.Name = Name;
      this.Score = Score;
  }
  
  public String getName() {
      return Name;
  }
  
  public void setName(String name) {
      Name = name;
  }
  
  public String getScore() {
      return Score;
  }
  
  public void setScore(String score) {
      Score = score;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Can anyone point out where i have gone wrong please... before i used to not get the name also and somehow i managed to get it and now struggling with the score</p>
  
  <p>Error</p>
  
  <pre><code>Process: com.appmaster.akash.messageplus, PID: 8881
                                               java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
                                                   at com.appmaster.akash.messageplus.TakingQuizDone$1.onDataChange(TakingQuizDone.java:68)
                                                   at com.google.android.gms.internal.zzduz.zza(Unknown Source)
                                                   at com.google.android.gms.internal.zzdwu.zzbvb(Unknown Source)
                                                   at com.google.android.gms.internal.zzdxa.run(Unknown Source)
                                                   at android.os.Handler.handleCallback(Handler.java:742)
                                                   at android.os.Handler.dispatchMessage(Handler.java:95)
                                                   at android.os.Looper.loop(Looper.java:157)
                                                   at android.app.ActivityThread.main(ActivityThread.java:5571)
                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
  </code></pre>