Skip to content

Commit e047593

Browse files
douglowderPlo4ox
authored andcommitted
tvOS: TV nav event emitter should check for bridge
Summary: When running with the packager in the tvOS simulator, reloading from the packager hits an assert in `RCTEventEmitter`, causing a crash. The solution is for `RCTTVNavigationEventEmitter` to check for the existence of the bridge before attempting to send an event. Manual testing. [IOS] [BUGFIX] [RCTTVNavigationEventEmitter.m] - Fix crash when reloading in tvOS Closes facebook#17797 Differential Revision: D7014975 Pulled By: hramos fbshipit-source-id: 0bf766e87267ca8592ff0cc0b3cb4621a8e8f9b5
1 parent 786e9e3 commit e047593

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

React/Modules/RCTTVNavigationEventEmitter.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ - (void)dealloc
4646

4747
- (void)handleTVNavigationEventNotification:(NSNotification *)notif
4848
{
49-
[self sendEventWithName:TVNavigationEventName body:notif.object];
49+
if (self.bridge) {
50+
[self sendEventWithName:TVNavigationEventName body:notif.object];
51+
}
5052
}
5153

5254
@end

0 commit comments

Comments
 (0)