Skip to content

Commit

Permalink
Comparison bug fixed.
Browse files Browse the repository at this point in the history
([n1 isKindOfClass:[NSNumber class]] == NO)
  • Loading branch information
przemyslawzygmunt committed Feb 3, 2017
1 parent 98e9e61 commit ebdfaf7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions SUPLA/SAChannel+CoreDataClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ - (BOOL) number:(NSNumber*)n1 isEqualToNumber:(id)n2 {
if ( n2 == nil && n1 != nil )
return NO;

if ( n1 != nil && n2 != nil ) {
if ( [n2 isKindOfClass:[NSNumber class]] == NO ) {
return NO;
} else if ( [n1 isEqualToNumber:n2] == NO ) {
return NO;
}
}
if ( [n1 isKindOfClass:[NSNumber class]] == NO || [n2 isKindOfClass:[NSNumber class]] == YES )
return NO; // is unknown

if ( n1 != nil && n2 != nil && [n1 isEqualToNumber:n2] == NO )
return NO;

return YES;
}
Expand Down

0 comments on commit ebdfaf7

Please sign in to comment.