From b52aea3fd2fe3dd67f4f90aae1f4935cc5326e71 Mon Sep 17 00:00:00 2001 From: Krzysztof Magiera Date: Mon, 24 Feb 2020 23:29:58 +0100 Subject: [PATCH] Hotfix for the case when views are invalidated but not removed from subviews The above situation may happen when grandparent is unmounted from react. In such a case children are not removed from non direct ancestors but still get invalidated. --- ios/RNSScreenStack.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/RNSScreenStack.m b/ios/RNSScreenStack.m index cc3c0f77..21172bab 100644 --- a/ios/RNSScreenStack.m +++ b/ios/RNSScreenStack.m @@ -367,7 +367,7 @@ NSMutableArray *pushControllers = [NSMutableArray new]; NSMutableArray *modalControllers = [NSMutableArray new]; for (RNSScreenView *screen in _reactSubviews) { - if (![_dismissedScreens containsObject:screen]) { + if (![_dismissedScreens containsObject:screen] && screen.controller != nil) { if (pushControllers.count == 0) { // first screen on the list needs to be places as "push controller" [pushControllers addObject:screen.controller];