Skip to content

Commit

Permalink
Explicit NSNumber pointer check
Browse files Browse the repository at this point in the history
The static analyzer points out a potential ambiguity where `if (number) { ... }`, where `number` is a `NSNumber` might be construed as either `if (number != nil) { ... }` or `if ([number boolValue]) { ... }`. They suggest making it explicit to avoid any ambiguity.
  • Loading branch information
robertmryan committed Jun 3, 2017
1 parent cb3e797 commit e167d54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fmdb/FMResultSet.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ - (int)columnIndexForName:(NSString*)columnName {

NSNumber *n = [[self columnNameToIndexMap] objectForKey:columnName];

if (n) {
if (n != nil) {
return [n intValue];
}

Expand Down

0 comments on commit e167d54

Please sign in to comment.