From aee95072e1eca937e0e671ae57a1c3e5ebb0f984 Mon Sep 17 00:00:00 2001 From: Aleksey Belouosv Date: Mon, 25 Feb 2019 12:59:51 +0300 Subject: [PATCH] [iOS] fix crash when deleting bookmarks list from list settings screen --- iphone/Maps/Bookmarks/BookmarksVC.mm | 1 - .../Maps/Bookmarks/Categories/BMCView/BMCViewController.swift | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iphone/Maps/Bookmarks/BookmarksVC.mm b/iphone/Maps/Bookmarks/BookmarksVC.mm index 0c9617fa2d..7ce2aa0b0b 100644 --- a/iphone/Maps/Bookmarks/BookmarksVC.mm +++ b/iphone/Maps/Bookmarks/BookmarksVC.mm @@ -579,7 +579,6 @@ CGFloat const kPinDiameter = 18.0f; - (void)categorySettingsController:(CategorySettingsViewController *)viewController didDelete:(MWMMarkGroupID)categoryId { - [self.navigationController popViewControllerAnimated:YES]; [self.delegate bookmarksVCdidDeleteCategory:self]; } diff --git a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift index 25b81f8db5..7eb7998c87 100644 --- a/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift +++ b/iphone/Maps/Bookmarks/Categories/BMCView/BMCViewController.swift @@ -380,6 +380,7 @@ extension BMCViewController: BookmarksVCDelegate { } func bookmarksVCdidDeleteCategory(_ viewController: BookmarksVC!) { - navigationController?.popViewController(animated: true) + guard let parentVC = parent else { return } + navigationController?.popToViewController(parentVC, animated: true) } }