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:
commit
8c4776208a
@ -266,15 +266,11 @@
|
|||||||
- (nullable NSArray<UIViewController *> *)getViewControllersForNavigationController:(nullable UINavigationController *)navigationController {
|
- (nullable NSArray<UIViewController *> *)getViewControllersForNavigationController:(nullable UINavigationController *)navigationController {
|
||||||
// Check if we are currently animating.
|
// Check if we are currently animating.
|
||||||
NSInteger index = [self.navigationQueue.operations indexOfObjectPassingTest:^BOOL(__kindof MVMCoreNavigationOperation * _Nonnull operation, NSUInteger idx, BOOL * _Nonnull stop) {
|
NSInteger index = [self.navigationQueue.operations indexOfObjectPassingTest:^BOOL(__kindof MVMCoreNavigationOperation * _Nonnull operation, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
if (operation.isExecuting) {
|
return operation.isExecuting && [operation isKindOfClass:[MVMCoreNavigationOperation class]];
|
||||||
*stop = YES;
|
|
||||||
return YES;
|
|
||||||
} else {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
if (index != NSNotFound) {
|
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];
|
MVMCoreNavigationOperation *operation = [self.navigationQueue.operations objectAtIndex:index];
|
||||||
if (operation.navigationObject.navigationController == navigationController && operation.futureViewControllers) {
|
if (operation.navigationObject.navigationController == navigationController && operation.futureViewControllers) {
|
||||||
// Return the future state if animating.
|
// Return the future state if animating.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user