From be3a94e20cd4a9b99346f8baa5d57ecc866715ae Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 15 Jan 2016 16:39:02 +0100 Subject: [PATCH] settings: fix crash when opening it too quickly --- Classes/SettingsView.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Classes/SettingsView.m b/Classes/SettingsView.m index 298fcd49e..9c5d2c9d2 100644 --- a/Classes/SettingsView.m +++ b/Classes/SettingsView.m @@ -282,6 +282,13 @@ INIT_WITH_COMMON_CF { } - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { + // when device is slow and you are typing an item too much, a crash may happen + // because we try to push the same view multiple times - in that case we should + // do nothing but wait for device to respond again. + if (self.navigationController.topViewController == viewController) { + return; + } + [UINavigationControllerEx removeBackground:viewController.view]; [viewController view]; // Force view