Skip to content

Commit e33e083

Browse files
Add null check for eventEmitter in dispatchCameraChangedEvent
1 parent e171d95 commit e33e083

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ios/RNMBX/RNMBXMapViewComponentView.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ - (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childCompo
120120
}
121121

122122
- (void)dispatchCameraChangedEvent:(NSDictionary*)event {
123+
if (self->_eventEmitter == nullptr) {
124+
return;
125+
}
123126
const auto [type, json] = RNMBXStringifyEventData(event);
124127
std::dynamic_pointer_cast<const facebook::react::RNMBXMapViewEventEmitter>(self->_eventEmitter)->onCameraChanged({type, json});
125128
}

0 commit comments

Comments
 (0)