fix reference compare to null
This commit is contained in:
parent
aa36487ec1
commit
252b879ef4
|
@ -416,7 +416,7 @@ public class RNFirebaseDatabase extends ReactContextBaseJavaModule {
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
public void off(String key, String eventRegistrationKey) {
|
public void off(String key, String eventRegistrationKey) {
|
||||||
RNFirebaseDatabaseReference nativeRef = references.get(key);
|
RNFirebaseDatabaseReference nativeRef = references.get(key);
|
||||||
if (nativeRef) {
|
if (nativeRef != null) {
|
||||||
nativeRef.removeEventListener(eventRegistrationKey);
|
nativeRef.removeEventListener(eventRegistrationKey);
|
||||||
|
|
||||||
if (!nativeRef.hasListeners()) {
|
if (!nativeRef.hasListeners()) {
|
||||||
|
|
Loading…
Reference in New Issue