Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
fix crashing when there is no superview (whoops)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Mar 12, 2015
1 parent 4f45718 commit 93675de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions HBTSStatusBarView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#import <Foundation/NSDistributedNotificationCenter.h>
#import <UIKit/UIApplication+Private.h>
#import <UIKit/UIImage+Private.h>
#import <UIKit/UIKitModernUI.h>
#import <UIKit/UIStatusBar.h>
#import <UIKit/UIStatusBarForegroundView.h>
#import <UIKit/UIStatusBarForegroundStyleAttributes.h>
Expand Down Expand Up @@ -219,7 +218,7 @@ - (void)receivedStatusNotification:(NSNotification *)notification {
}

- (void)showWithTimeout:(NSTimeInterval)timeout {
if ([UIApplication sharedApplication].statusBarHidden) {
if ([UIApplication sharedApplication].statusBarHidden || !self.superview || ![self.superview isKindOfClass:UIStatusBar.class]) {
return;
}

Expand Down

0 comments on commit 93675de

Please sign in to comment.