diff --git a/React/Views/RCTTVView.m b/React/Views/RCTTVView.m index e3c44f6db..d27aded86 100644 --- a/React/Views/RCTTVView.m +++ b/React/Views/RCTTVView.m @@ -173,9 +173,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:unused) if (hasTVPreferredFocus) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ UIView *rootview = self; - while(![rootview isReactRootView]) { + while (![rootview isReactRootView] && rootview != nil) { rootview = [rootview superview]; } + if (rootview == nil) return; + rootview = [rootview superview]; [(RCTRootView *)rootview setReactPreferredFocusedView:self];