Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request gotosleep#62 from alias1/checkBeforeRemoveObservers
Check _centerPanel exists
  • Loading branch information
gotosleep committed Mar 2, 2013
2 parents 8c0e4ab + 3bbbbc6 commit 7dd7c11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions JASidePanels/Source/JASidePanelController.m
Expand Up @@ -107,8 +107,10 @@ + (UIImage *)defaultImage {
#pragma mark - NSObject

- (void)dealloc {
[_centerPanel removeObserver:self forKeyPath:@"view"];
[_centerPanel removeObserver:self forKeyPath:@"viewControllers"];
if (_centerPanel) {
[_centerPanel removeObserver:self forKeyPath:@"view"];
[_centerPanel removeObserver:self forKeyPath:@"viewControllers"];
}
}

//Support creating from Storyboard
Expand Down

0 comments on commit 7dd7c11

Please sign in to comment.