[ios][database] Prevent null value being passed to JSEvent

This commit is contained in:
Elliot Hesp 2017-06-16 08:39:16 +01:00
parent 3809fa8f63
commit bafd59283f
1 changed files with 1 additions and 0 deletions

View File

@ -33,6 +33,7 @@
if (!_listeners[listenerId]) {
id andPreviousSiblingKeyWithBlock = ^(FIRDataSnapshot *_Nonnull snapshot, NSString *_Nullable previousChildName) {
NSDictionary *props = [RNFirebaseDBReference snapshotToDict:snapshot];
if (previousChildName == nil) previousChildName = @"";
[self sendJSEvent:DATABASE_DATA_EVENT title:eventName props:@{@"eventName": eventName, @"refId": _refId, @"listenerId": listenerId, @"path": _path, @"snapshot": props, @"previousChildName":previousChildName}];
};
id errorBlock = ^(NSError *_Nonnull error) {