Merge branch 'bugfix/prevent_navigation_introspection_crash' into 'develop'

test to make sure we are looking at an MVMCoreNavigationOperation before casting.

See merge request BPHV_MIPS/mvm_core!116
This commit is contained in:
Pfeil, Scott Robert 2020-10-14 12:10:15 -04:00
commit 8c4776208a

View File

@ -266,15 +266,11 @@
- (nullable NSArray<UIViewController *> *)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.