Browse Source

fix flaky top bar transition

yogevbd 6 years ago
parent
commit
3fd9cdfe5b
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      lib/ios/RNNRootViewController.m

+ 3
- 3
lib/ios/RNNRootViewController.m View File

@@ -100,7 +100,7 @@
100 100
 		} if ([self.navigationItem.title isKindOfClass:[RNNCustomTitleView class]] && !_customTitleView) {
101 101
 			self.navigationItem.title = nil;
102 102
 		}
103
-    } else if (_customTitleView.superview == nil) {
103
+    } else if (_customTitleView && _customTitleView.superview == nil) {
104 104
         if ([self.navigationItem.title isKindOfClass:[RNNCustomTitleView class]] && !_customTitleView) {
105 105
             self.navigationItem.title = nil;
106 106
         }
@@ -120,7 +120,7 @@
120 120
 		} else if ([[self.navigationController.navigationBar.subviews lastObject] isKindOfClass:[RNNCustomTitleView class]] && !_customTopBar) {
121 121
 			[[self.navigationController.navigationBar.subviews lastObject] removeFromSuperview];
122 122
 		}
123
-    } else if (_customTopBar.superview == nil) {
123
+    } else if (_customTopBar && _customTopBar.superview == nil) {
124 124
         if ([[self.navigationController.navigationBar.subviews lastObject] isKindOfClass:[RNNCustomTitleView class]] && !_customTopBar) {
125 125
             [[self.navigationController.navigationBar.subviews lastObject] removeFromSuperview];
126 126
         }
@@ -140,7 +140,7 @@
140 140
 			[[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
141 141
 			self.navigationController.navigationBar.clipsToBounds = NO;
142 142
 		}
143
-    } if (_customTopBarBackground.superview == nil) {
143
+    } if (_customTopBarBackground && _customTopBarBackground.superview == nil) {
144 144
         if ([[self.navigationController.navigationBar.subviews objectAtIndex:1] isKindOfClass:[RNNCustomTitleView class]]) {
145 145
             [[self.navigationController.navigationBar.subviews objectAtIndex:1] removeFromSuperview];
146 146
         }