diff --git a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m index 7e9bb82..a88076e 100644 --- a/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m +++ b/MVMCore/MVMCore/PresentationHandling/MVMCoreNavigationHandler.m @@ -266,15 +266,11 @@ - (nullable NSArray *)getViewControllersForNavigationController:(nullable UINavigationController *)navigationController { // Check if we are currently animating. NSInteger index = [self.navigationQueue.operations indexOfObjectPassingTest:^BOOL(__kindof MVMCoreNavigationOperation * _Nonnull operation, NSUInteger idx, BOOL * _Nonnull stop) { - if (operation.isExecuting) { - *stop = YES; - return YES; - } else { - return NO; - } + return operation.isExecuting && [operation isKindOfClass:[MVMCoreNavigationOperation class]]; }]; if (index != NSNotFound) { + // Test above ensures we have an MVMCoreNavigationOperation. There are situations where block operations are submitted to the queue to be executed. MVMCoreNavigationOperation *operation = [self.navigationQueue.operations objectAtIndex:index]; if (operation.navigationObject.navigationController == navigationController && operation.futureViewControllers) { // Return the future state if animating.