From e35415efc1e27ca3b73f0d13221a5f0459fd4813 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 7 Mar 2017 10:17:10 +0100 Subject: [PATCH] Fix crash : do not remove deallocated observer --- Classes/ContactDetailsView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/ContactDetailsView.m b/Classes/ContactDetailsView.m index 727a19190..d5a7b4f1d 100644 --- a/Classes/ContactDetailsView.m +++ b/Classes/ContactDetailsView.m @@ -222,7 +222,9 @@ } - (void)viewWillDisappear:(BOOL)animated { - [_tableController.tableView removeObserver:self forKeyPath:@"contentSize"]; + if (_tableController && _tableController.tableView && [_tableController.tableView observationInfo]) { + [_tableController.tableView removeObserver:self forKeyPath:@"contentSize"]; + } [super viewWillDisappear:animated]; PhoneMainView.instance.currentName = NULL; if (self.tmpContact) {