|
@@ -202,13 +202,17 @@ static NSString* const setDefaultOptions = @"setDefaultOptions";
|
202
|
202
|
RNNAssertMainQueue();
|
203
|
203
|
|
204
|
204
|
RNNComponentViewController *vc = (RNNComponentViewController*)[RNNLayoutManager findComponentForId:componentId];
|
205
|
|
- RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
|
206
|
|
- [vc overrideOptions:options];
|
207
|
|
-
|
208
|
|
- [vc.stack pop:vc animated:[vc.resolveOptionsWithDefault.animations.pop.enable getWithDefaultValue:YES] completion:^{
|
209
|
|
- [_eventEmitter sendOnNavigationCommandCompletion:pop commandId:commandId params:@{@"componentId": componentId}];
|
210
|
|
- completion();
|
211
|
|
- } rejection:rejection];
|
|
205
|
+ if (vc) {
|
|
206
|
+ RNNNavigationOptions *options = [[RNNNavigationOptions alloc] initWithDict:mergeOptions];
|
|
207
|
+ [vc overrideOptions:options];
|
|
208
|
+
|
|
209
|
+ [vc.stack pop:vc animated:[vc.resolveOptionsWithDefault.animations.pop.enable getWithDefaultValue:YES] completion:^{
|
|
210
|
+ [self->_eventEmitter sendOnNavigationCommandCompletion:pop commandId:commandId params:@{@"componentId": componentId}];
|
|
211
|
+ completion();
|
|
212
|
+ } rejection:rejection];
|
|
213
|
+ } else {
|
|
214
|
+ [RNNErrorHandler reject:rejection withErrorCode:1012 errorDescription:[NSString stringWithFormat:@"Popping component failed - componentId '%@' not found", componentId]];
|
|
215
|
+ }
|
212
|
216
|
}
|
213
|
217
|
|
214
|
218
|
- (void)popTo:(NSString*)componentId commandId:(NSString*)commandId mergeOptions:(NSDictionary *)mergeOptions completion:(RNNTransitionCompletionBlock)completion rejection:(RCTPromiseRejectBlock)rejection {
|