Skip to content

Commit

Permalink
Fixed potential crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
KrauseFx committed May 7, 2013
1 parent 3153a5f commit c98c6cf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Classes/TSMessage.m
Expand Up @@ -185,6 +185,8 @@ - (id)init

- (void)fadeInCurrentNotification
{
if ([self.messages count] == 0) return;

notificationActive = YES;

TSMessageView *currentView = [self.messages objectAtIndex:0];
Expand Down Expand Up @@ -276,7 +278,11 @@ - (void)fadeOutNotification:(TSMessageView *)currentView
{
[currentView removeFromSuperview];

[self.messages removeObjectAtIndex:0];
if ([self.messages count] > 0)
{
[self.messages removeObjectAtIndex:0];
}

notificationActive = NO;

if ([self.messages count] > 0)
Expand Down

0 comments on commit c98c6cf

Please sign in to comment.