Skip to content

Conversation

@SUPERCILEX
Copy link
Collaborator

No description provided.

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

(cherry picked from commit 371c211)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
String key = data.getKey();
mDataRef.child(key).removeEventListener(mRefs.remove(mDataRef.getRef().child(key)));
ValueEventListener listener = mRefs.remove(mDataRef.getRef().child(key));
if (listener != null) mDataRef.child(key).removeEventListener(listener);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My app keeps crashing randomly with NPEs so I'm starting to think this could be getting called twice in really weird cases. Unfortunately, I've never been able to consistently reproduce it, but it can't hurt to add a null check.

@samtstern
Copy link
Contributor

LGTM

@samtstern samtstern merged commit 812ff23 into firebase:version-2.0.0-dev Mar 14, 2017
@SUPERCILEX SUPERCILEX deleted the cleanup-IndexArray branch March 14, 2017 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants