[ios] Fixed assert when controller is there but in a wrong order

Reproduced by opening Downloader and zooming to any downloaded country.

Signed-off-by: Alexander Borsuk <me@alex.bio>
This commit is contained in:
Alexander Borsuk 2022-09-04 00:06:04 +03:00 committed by Alexander Borsuk
parent f5c9d89eeb
commit 142e891e16

View file

@ -333,10 +333,10 @@ using namespace osm_auth_ios;
#pragma mark - Properties
- (MapViewController *)mapViewController {
auto obj = [(UINavigationController *)self.window.rootViewController viewControllers].firstObject;
if ([obj isKindOfClass:[MapViewController class]])
return obj;
for (id vc in [(UINavigationController *)self.window.rootViewController viewControllers]) {
if ([vc isKindOfClass:[MapViewController class]])
return vc;
}
NSAssert(false, @"Please check the logic");
return nil;
}