Skip to content

Commit

Permalink
tvOS: TV nav event emitter should check for bridge
Browse files Browse the repository at this point in the history
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 #17797

Differential Revision: D7014975

Pulled By: hramos

fbshipit-source-id: 0bf766e87267ca8592ff0cc0b3cb4621a8e8f9b5
  • Loading branch information
douglowder authored and facebook-github-bot committed Feb 16, 2018
1 parent 2123108 commit 3a3d884
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion React/Modules/RCTTVNavigationEventEmitter.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ - (void)dealloc

- (void)handleTVNavigationEventNotification:(NSNotification *)notif
{
[self sendEventWithName:TVNavigationEventName body:notif.object];
if (self.bridge) {
[self sendEventWithName:TVNavigationEventName body:notif.object];
}
}

@end

0 comments on commit 3a3d884

Please sign in to comment.