Skip to content

Commit

Permalink
Fixed bug when mostRecentMessageTimestampForRoom returns nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Urban committed Aug 6, 2015
1 parent e09d5a3 commit 87f79b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Extensions/XEP-0045/CoreDataStorage/XMPPRoomCoreDataStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,11 @@ - (NSDate *)mostRecentMessageTimestampForRoom:(XMPPJID *)roomJID
NSString *streamBareJidStr = [[self myJIDForXMPPStream:xmppStream] bare];

NSString *predicateFormat = @"roomJIDStr == %@ AND streamBareJidStr == %@";
predicate = [NSPredicate predicateWithFormat:predicateFormat, roomJID, streamBareJidStr];
predicate = [NSPredicate predicateWithFormat:predicateFormat, roomJID.bare, streamBareJidStr];
}
else
{
predicate = [NSPredicate predicateWithFormat:@"roomJIDStr == %@", roomJID];
predicate = [NSPredicate predicateWithFormat:@"roomJIDStr == %@", roomJID.bare];
}

NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"localTimestamp" ascending:NO];
Expand Down

0 comments on commit 87f79b6

Please sign in to comment.