Skip to content

Cleanup index array #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 14, 2017
Merged

Cleanup index array #632

merged 2 commits into from
Mar 14, 2017

Conversation

SUPERCILEX
Copy link
Collaborator

No description provided.

Signed-off-by: Alex Saveau <[email protected]>

(cherry picked from commit 371c211)
Signed-off-by: Alex Saveau <[email protected]>
}
}

protected void onKeyRemoved(DataSnapshot data, int index) {
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