title: Firebase onDataChange on null object reference
body: <p>I have the simple code to get the group members as:</p>
  
  <pre><code>ValueEventListener getGroupMembersListener;
  
  presentGroupMembers = myFirebase.child("groupMembers").child(groupID);
  
          presentGroupMembers.addListenerForSingleValueEvent(getGroupMembersListener);
  
          getGroupMembersListener = new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  for (DataSnapshot groupMemberSnapshot : dataSnapshot.getChildren()) {
  
                      if (!groupMemberSnapshot.getKey().equals(preference.getUserSyncID(getApplicationContext()))) {
                          Member groupMember = new Member();
                          groupMember.setUserUID(groupMemberSnapshot.getKey());
                          groupMember.setUserName(groupMemberSnapshot.getValue().toString());
  
                          mGroupMembers.add(groupMember);
  
                          Log.v("InvitingFriendsToGroups", "Group member userName is: " + groupMemberSnapshot.getValue().toString());
                          Log.v("InvitingFriendsToGroups", "Group member user ID is: " + groupMemberSnapshot.getKey().toString());
                      }
                  }
  
              }
  
              @Override
              public void onCancelled(FirebaseError firebaseError) {
                  Log.v("InvitingFriendsToGroups", "Firebase Error: " + firebaseError.toString());
  
              }
          };
  </code></pre>
  
  <p>Yet I continually receive the error:</p>
  
  <pre><code>03-11 21:57:56.995 9100-9100/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com.example.android.appv2, PID: 9100
                                                   java.lang.NullPointerException: Attempt to invoke interface method 'void com.firebase.client.ValueEventListener.onDataChange(com.firebase.client.DataSnapshot)' on a null object reference
                                                       at com.firebase.client.Query$1.onDataChange(Query.java:144)
                                                       at com.firebase.client.core.ValueEventRegistration.fireEvent(ValueEventRegistration.java:56)
                                                       at com.firebase.client.core.view.DataEvent.fire(DataEvent.java:45)
                                                       at com.firebase.client.core.view.EventRaiser$1.run(EventRaiser.java:38)
                                                       at android.os.Handler.handleCallback(Handler.java:739)
                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       at android.os.Looper.loop(Looper.java:145)
                                                       at android.app.ActivityThread.main(ActivityThread.java:6840)
                                                       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:1404)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
  </code></pre>
  
  <p>I have been using Firebase for several weeks and this error has never appeared, nor on my far more complex queries.</p>
  
  <p>What could be incorrect with this setup?</p>