Browse Source

Explicit NSNumber pointer check

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.
Robert M. Ryan 8 years ago
parent
commit
e167d5494c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/fmdb/FMResultSet.m

+ 1 - 1
src/fmdb/FMResultSet.m

@@ -221,7 +221,7 @@ - (int)columnIndexForName:(NSString*)columnName {
     
     NSNumber *n = [[self columnNameToIndexMap] objectForKey:columnName];
     
-    if (n) {
+    if (n != nil) {
         return [n intValue];
     }